Skip to content

🐛 --cache changes behavior around unlisted dependencies and unused files #1156

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Prerequisites

Reproduction url

mochajs/mocha#5394

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

Running Knip with or without --cache is giving different reports.

Setup:

gh repo clone https://github.com/mochajs/mocha
cd mocha
gh pr checkout 5394
npm i

Locally without cache:

joshgoldberg ~/repos/mocha $ npx knip
Analyzing workspace…
Unlisted dependencies (1)
webpack-cli  test/browser-specific/fixtures/webpack/webpack.config.js

Locally with cache:

joshgoldberg ~/repos/mocha $ npx knip --cache
Unused files (1)
lib/nodejs/worker.js  

In CI with cache:

CI mode enabled
Github Actions detected
output dir: /tmp/mocha-test-webpack
Unlisted dependencies (1)
webpack-cli  test/browser-specific/fixtures/webpack/webpack.config.js

Spooky! 👻

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions