You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, thanks for creating and maintaining knip - I really like this tool.
When I scan my project, I'm getting some false positives and they're coming from the jest configuration. Files such as: <rootDir>/some_file.ts are listed as unused. I have the rootDir property set to ./src in jest config file.
Hello, thanks for creating and maintaining
knip
- I really like this tool.When I scan my project, I'm getting some false positives and they're coming from the
jest
configuration. Files such as:<rootDir>/some_file.ts
are listed as unused. I have therootDir
property set to./src
injest
config file.I took a closer look at the
jest
plugin configuration and I noticed that in this line https://github.com/webpro/knip/blob/59d437d7184bbe5374da00be60ea25993eb63c72/src/plugins/jest/index.ts#L90 the plugin replaces the<rootDir>/
string with the empty one. It seems to me that this is not correct for projects that have therootDir
property defined in thejest
configuration (see: https://jestjs.io/docs/configuration#rootdir-string).When I change this code line to:
knip doesn't list those file as unused which is the expected behaviour.
The text was updated successfully, but these errors were encountered: