Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies that are executed as a sub-command are not detected. #243

Closed
ChiefORZ opened this issue Sep 18, 2023 · 2 comments
Closed

Dependencies that are executed as a sub-command are not detected. #243

ChiefORZ opened this issue Sep 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ChiefORZ
Copy link
Contributor

When using knip to detect unused cli commands following example would detect esbuild as correctly being used:

# package.json
{
  "scripts": {
    "build:esbuild": "esbuild src/index.ts --outdir=build",
  }
}
➜ pnpm knip         
Unused dependencies (2)
eslint              package.json
eslint-config-next  package.json

But when invoking this command with nx to enable caching, knip lists esbuild as unused dependency:

# package.json
{
  "scripts": {
    "build:esbuild": "nx exec -- esbuild src/index.ts --outdir=build",
  }
}
➜ pnpm knip
Unused dependencies (2)
eslint              package.json
eslint-config-next  package.json

Unused devDependencies (1)
esbuild  package.json
@ChiefORZ ChiefORZ added the bug Something isn't working label Sep 18, 2023
@webpro webpro closed this as completed in 5ba99e7 Sep 18, 2023
@webpro
Copy link
Member

webpro commented Sep 18, 2023

🚀 This issue has been resolved in v2.25.0. See Release 2.25.0 for release notes.

@webpro
Copy link
Member

webpro commented Sep 18, 2023

Thanks @ChiefORZ, added the Nx binary resolver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants