webpro-nl / knip

✂️ Find unused files, dependencies and exports in your JavaScript and TypeScript projects. Knip it before you ship it!
https://knip.dev
ISC License
6.66k stars 156 forks source link

False positives being reported on two packages #707

Closed jonahallibone closed 2 months ago

jonahallibone commented 3 months ago

Until yesterday, my repository correctly listed no unused dependencies.

SInce the release, I am getting this report:

Screenshot 2024-06-27 at 4 03 37 PM

Nothing with these files changed, nor did any dependencies other than knip change.

I am using a next.js project in a monorepo. Here is my config:

{
  "workspaces": {
    "frontend": {
      "ignore": [
        "src/hooks/general/use-interval.ts",
        "src/scripts/generate-types.ts",
        "tests/**",
        "./api",
        "./empty-module.ts"
      ],
      "ignoreDependencies": [
        "@hookform/devtools",
        "styles/*",
        "prosemirror-*",
        "puppeteer",
        "./api"
      ]
    }
  }
}

It is run in github actions via

npx knip --production --dependencies --include files --exclude unlisted,unresolved --reporter markdown
webpro commented 3 months ago

Of course there can be a regression. But sometimes a fix in a lib seemingly "breaks" things for you. What's the exact version that degrades behavior in your case?

Please read https://knip.dev/guides/issue-reproduction.

Apart from the issue reported, what I can say from this configuration is that you probably want to read up on https://knip.dev/guides/configuring-project-files

webpro commented 2 months ago

Closing due to inactivity. Feel free to open a new issue with an actionable reproduction.

jonahallibone commented 2 months ago

Closing due to inactivity. Feel free to open a new issue with an actionable reproduction.

New versions stopped reporting mapbox-gl as unused, however, ag-grid-react was my bad. Someone migrated to their ES package and I didn't notice. Thanks for the help @webpro