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

add option to include special files in the check for unused dependencies #223

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

rouanw
Copy link
Contributor

@rouanw rouanw commented Mar 16, 2017

Example:

$ npm-check --specials=eslint,webpack

depcheck supports the concept of specials which are special parsers to check files other than your usual JavaScript source code. (See https://github.com/depcheck/depcheck#special.)

Current support includes npm scripts, eslint, webpack, babel and mocha. (See https://github.com/depcheck/depcheck/tree/master/src/special for the full list.)

This PR adds specials to the API and CLI and passes the value through to depcheck when checking for unused dependencies.

I've opened a PR in depcheck - depcheck/depcheck#206 - to make the list of available options clearer in the documentation.

@rouanw
Copy link
Contributor Author

rouanw commented Apr 19, 2017

@amilajack / @LinusU - would you mind taking a look please?

@amilajack
Copy link
Collaborator

@rouanw is this supposed to save npm-check from having to guess the special deps?

@rouanw
Copy link
Contributor Author

rouanw commented Apr 19, 2017

Hi @amilajack. No, it is basically a way to tell npm-check to also check for usages in some 'special' files. For example, your .eslintrc, webpack.config.js and your npm scripts, like test. This reduces the number of false positives when checking for unused dependencies.

The naming is unfortunately not very intuitive, but I stuck to using the depcheck naming to avoid having to maintain additional documentation and mapping code.

@amilajack amilajack merged commit 3e7f48a into dylang:master Apr 19, 2017
@rouanw rouanw deleted the depcheck_specials branch March 6, 2020 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants