dylang / npm-check

Check for outdated, incorrect, and unused dependencies.
https://www.npmjs.com/package/npm-check
MIT License
6.58k stars 236 forks source link

Doesn't work with pre-commit and pre-push #168

Open AlexChesters opened 8 years ago

AlexChesters commented 8 years ago

This package doesn't work with pre-commit and pre-push as these modules aren't required in. Instead, these packages are used by adding a pre-commit and pre-push property to your repositories package.json. It would be nice if npm-check could account for this.

Here is a repo which illustrates this issue and the output is below

 ~/Desktop/code/ukpd-api/ [master] npm-check

pre-commit   😕  NOTUSED?  Still using pre-commit?
                          Depcheck did not find code similar to require('pre-commit') or import from 'pre-commit'.
                          Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                          Use --skip-unused to skip this check.
                          To remove this package: npm uninstall --save-dev pre-commit

pre-push     😕  NOTUSED?  Still using pre-push?
                          Depcheck did not find code similar to require('pre-push') or import from 'pre-push'.
                          Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                          Use --skip-unused to skip this check.
                          To remove this package: npm uninstall --save-dev pre-push

Here is a link to the package.json in question.

LinusU commented 8 years ago

Hmm, this is interesting. I think the only way we can implement this is to make a specific checker for those packages...

Should be quite easy to implement though :)