knip icon indicating copy to clipboard operation
knip copied to clipboard

Workspace dependencies with `exports` subpath not detected as used

Open fauxbytes opened this issue 3 months ago • 1 comments

Prerequisites

Reproduction url

repro repo attached

Reproduction access

  • [x] I've made sure the reproduction is publicly accessible

Description of the issue

$ cd apps/server
$ pnpm install
$ pnpm knip --dependencies
Unused devDependencies (1)
@repo/jest-config  package.json:6:6
  • Using --trace-file jest.config.ts shows the file is analyzed but the workspace package import is not traced.

knip-repro.zip

fauxbytes avatar Dec 31 '25 01:12 fauxbytes

You're supposed to put knip.json at root level (just like pnpm-workspace.yaml).

Also see https://knip.dev/features/monorepos-and-workspaces#lint-a-single-workspace

webpro avatar Dec 31 '25 07:12 webpro

Closing this as I think it's adequately answered.

webpro avatar Jan 15 '26 05:01 webpro