eslint: dependency wrongly mark as unused
See original GitHub issueThis is likely introduced by https://github.com/depcheck/depcheck/issues/476 and https://github.com/depcheck/depcheck/pull/477
Back in this previous issue, the contributor (@sveyret) wrote:
when analyzing eslint configuration dependencies, it does not look at this dependencies’ dependencies.
It should not, seems to me this is defeating the general behavior of depcheck
. Any dependency that is explicitly used or imported in the project should be declared in package.json
, even if it’s already made available by another dependency. I just spent some time troubleshooting this in a project.
I had the following eslint config:
extends:
- standard-jsx
- standard-react
And the following lines in package.json
:
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-jsx": "^8.1.0",
"eslint-config-standard-react": "^9.0.0",
And depcheck was outputing:
Unused devDependencies
* eslint-config-standard-jsx
Because eslint-config-standard-jsx
is a dependency of eslint-config-standard-react
, it’s marked as ‘unused’. I don’t think that’s right.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
Hi @znarf, I made a pull request (#506) which should correct your issue. Would you please have time to check it?
For information, I’ll take the point tomorrow if I can find time.