🐛 Dev dependencies are reported as unused
Prerequisites
- [X] I'm using the latest version
- [X] I've read the relevant documentation
- [X] I've searched for existing issues
- [X] I've checked the list of known issues
- [X] I've read the issue reproduction guide
Reproduction url
Reproduction access
- [X] I've made sure the reproduction is publicly accessible
Description of the issue
Currently dev dependencies are reported as unused if they are not included in any entry files.
However, commonly dev dependencies are used in none poduction code. I can't seem to find a way to tell knip that if it's used in a development file then it's okay.
Example configuration:
entry: ['src/index.{ts,tsx}!'],
project: [
'**/*.{ts,tsx,vue}!',
'!**/*.{bench,test,test-d}.{ts,tsx}!',
]
If a dev dependency is used in a test file it will still report as unused, the only way to resolve would be to include the test files as entry points. However; this is really slow (our monorepo won't run knip with that setting as it just hangs).
A reproduction is required, not sure exactly what you're doing and what you're expecting.
Did you add the --production or --strict flag? In strict production mode it won't report dev dependencies.
our monorepo won't run knip with that setting as it just hangs
You could try --isolate-workspaces.
Closing due to inactivity.