Closed stephenwade closed 2 months ago
Regardless of whether this is a bug or not, this seems to work the same for a while:
npx knip@5.0.0
Unlisted dependencies (1)
node_modules/react-toastify/dist/components app/ToastContainer.tsx
The values in ignoreDependencies
are package names so either "name"
or "@scope/name"
- so in this case the odd "node_modules"
would do.
Will investigate some more later on.
The issue is not that it appears as an unlisted dependency. The issue is that I can no longer ignore that report with "ignoreDependencies"
.
You can use literally "ignoreDependencies": ["node_modules"]
That works, thank you!
I'll leave the issue open for the underlying issue that Knip should detect this import as react-toastify
and not need any "ignoreDependencies"
config.
:rocket: This issue has been resolved in v5.30.2. See Release 5.30.2 for release notes.
Using Knip in a commercial project? Please consider becoming a sponsor.
Prerequisites
Reproduction url
https://github.com/stephenwade/knip-issue-repro-crispy-broccoli
Reproduction access
Good version
5.27.3
Bad version
5.27.4
Description of the regression
In my project, I import a type from
'node_modules/react-toastify/dist/components'
because'react-toastify'
doesn't export it. To get around Knip reporting it as an unlisted dependency, I added this to my config file:In version 5.27.3, Knip reports no issues. In version 5.27.4 and later, I get this report:
I haven't found a configuration that works for my project since the update.
I think the issue is likely caused by 89780376.
(ref: https://github.com/stephenwade/festival/pull/1693)