'extends: eslint:recommended' causes *all* rules to be considered used
See original GitHub issueTake the following minimal .eslintrc.yaml
:
extends: eslint:recommended
When I run eslint-find-rules -c .eslintrc.yaml
it dumps a list of every eslint rule, which is extremely unhelpful.
I think the problem here is that eslint:recommended
is implemented by setting the value for non-recommended rules to off
instead of leaving them out. The only workaround I can think of for this is to explicitly mask out eslint:recommended
and then later fill them back in. However, this seems like a bit of a bodge; is there a better way to do this?
The alternative is to add a flag such as --off-is-unused
to consider any rules which have been turned off to be unused. Of course, that would prevent rules from being removed from the list.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Rules - ESLint - Pluggable JavaScript Linter
Rules in ESLint are grouped by type to help you understand their purpose. Each rule has emojis denoting: ✓ Recommended. The "extends": "eslint:recommended" ......
Read more >What are Eslint rules? - Dev Genius
Rules are restrictions that a given block of code must follow. Eslint comes with its own set of rules but you can create...
Read more >What is the difference between extends and plugins in ESLint ...
Although ESLint ships with some good set of rules, usually they are not enough to cover all the needs for your project, especially...
Read more >eslint-config-prettier - GitHub
GitHub - prettier/eslint-config-prettier: Turns off all rules that are unnecessary or might ... Put "plugin:prettier/recommended" in your "extends" .
Read more >12 essential ESLint rules for React - LogRocket Blog
To use the recommended rule set, just add 'plugin:react/recommended' to your ESLint configuration's extends section:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think that if you want the recommended set to only list the rules it’s enabling, that perhaps that’s a change that should be made upstream in eslint itself?
Definitely.
But as I do not have the perfect idea about how to approach this, I’d recommend to use
eslint-diff-rules
in verbose mode as a workaround in the meanwhile:eslint-diff-rules [your own config] ./node_modles/eslint/conf/eslint-recommended.js -v