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
husky released a new version 9.1. In that release they removed the necessity to call binaries with npx.
When removing npx, knip does not recognize these binaries anymore and flags them as not used.
The issue is that only scripts in package.json#scripts are supposed to reference binaries installed in node_modules. Package managers add node_modules/.bin to the PATH.
My I guess is that husky is doing something similar, but Knip is unaware of that "magic".
For now the best option is to add lint-staged to ignoreDependencies. We might consider treating husky scripts the same as package.json#scripts.
Reproduction url
https://stackblitz.com/edit/github-jt9pwf?file=package.json,.husky%2Fpre-commit
Description of the issue
husky released a new version 9.1. In that release they removed the necessity to call binaries with
npx
.When removing npx, knip does not recognize these binaries anymore and flags them as not used.
Release Notes for husky: https://github.com/typicode/husky/releases/tag/v9.1.1
The reproduction url shows the problem:
npx lint-staged
knip is happy and runs without an errorI'm guessing knip does search for some form of
npx
, so removing is does currently not work with the new version.The text was updated successfully, but these errors were encountered: