-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Knip output differs depending on the presence of dist
#459
Comments
Quoting from https://knip.dev/features/production-mode#strict-mode:
Unfortunately there's no clear-cut solution for this yet. Related to #248. |
To clarify, I don't feel that strongly about whether it should be in |
It's a bit of double-edged sword: adding (This is how the TypeScript backend works w/ The correct result in this case seems to be that there are no unused dependencies. There's no way for Knip to understand that e.g. Related/similar: #472 (comment) |
Is |
Knip ignores it, but the TypeScript backend does not. |
Just in case, this happens only in a monorepo. When I was trying to come up with a repro, I couldn't get it with just a simple plain package. If you go to the same repro above, do an
Then do a |
Hi! I finally updated Knip from 2.41.5 to 4.0.3 and it told me to move some type-only dependencies from
devDependencies
todependencies
, which I did (this is desired). Then I pushed these changes and Knip failed in CI, asking me to do the exact opposite of the above. The only difference is the absence ofdist
directories, as we don't build before static checks.Made a repro. Run
npm run test
and observe this:Then run
npm run build
andnpm run test
again, no error.Seems like some sort of composite project issue? Not sure.
The text was updated successfully, but these errors were encountered: