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

False unused alert for local CLI tools/ binaries. #145

Closed
Zerim opened this issue Jun 8, 2016 · 3 comments
Closed

False unused alert for local CLI tools/ binaries. #145

Zerim opened this issue Jun 8, 2016 · 3 comments

Comments

@Zerim
Copy link

Zerim commented Jun 8, 2016

For example, I am using depcheck in our project in the following manner:

npm install depcheck #installed locally for better developer experience
./node_modules/depcheck/bin/depcheck #saved as npm script in package.json

I'm not sure what the best solution is here. Perhaps not trigger alerts on local binaries that are used by npm scripts, grunt, etc.

@lijunle
Copy link
Member

lijunle commented Jun 19, 2016

Hi, @Zerim, thanks for reporting issue.

There is a simple detector for CLI command, however, it does not cover all test cases. Could you please more details about your case, which binary is reported as false alert?

@Zerim
Copy link
Author

Zerim commented Jun 26, 2016

Actually just ran depcheck again on our project and not seeing any of these. I think it may be because I switched from npm 3.x back down to 2.x.

In 3.x since peer dependencies must exist in one flat node_modules folder, I think it's possible to end up with dependencies in your package.json that are actually peer dependencies of a CLI tool or other module. I think a good example of this might be eslint-watch... Look at the difference between their 2.x and 3.x installation instructions as local dependencies. I think with their 3.x installation - if all you ever use in your npm scripts is esw, then eslint would show up as an unused dependency.

@mnkhouri
Copy link
Member

I'm doing a little cleanup of older issues, it appears this issue was resolved as of the latest comment. Please feel free to open a new issue if you see something similar to this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants