--report-unused-disable-directives should be autofixable
See original GitHub issueThe version of ESLint you are using. v5.16.0
The problem you want to solve.
I want to enable --report-unused-disable-directives
on a large existing codebase, but it surfaces too many problems to be practical to fix manually. So I’d need to write a script. At that point, why not make the directive autofixable?
Your take on the correct solution to problem.
Run eslint --fix --report-unused-disable-directives
Are you willing to submit a pull request to implement this change? Yes
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:15 (12 by maintainers)
Top Results From Across the Web
Command Line Interface - ESLint - Pluggable JavaScript Linter
The CLI has a variety of options that you can pass to configure ESLint. ... or rules --report-unused-disable-directives Adds reported errors for unused ......
Read more >eslint/eslint - Gitter
Hello, is there a timeline for when 6.0.0 will be out of alpha and stable? It has a fix for a js-yaml security...
Read more >eslint-plugin-relations - npm
import something you should now and suppress eslint rule. If checked using --report-unused-disable-directives , then "not violation" will ...
Read more >demo-outil-edition - node_modules - eslint - CHANGELOG.md
196c102 Fix: valid-jsdoc should allow optional returns for async ... f90462e Fix: no-extra-label autofix should not remove labels used ...
Read more >@ken0x0a/eslint-config - npm Package Health Analysis | Snyk
You can connect your project's repository to Snyk to stay up to date on ... '@ken0x0a/eslint-config/autofix'], } // or if you prefer to...
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 Free
Top 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
The team agreed that we’d like a way to autofix unused disable directives! Now we need an RFC to figure out how it should be implemented. So far we only autofix rules, so this will be a completely new type of autofixing. We’re not sure that including this autofix in
--fix
is necessarily the right solution. Maybe we need a new CLI option, or maybe we can use--fix
but with a new--fix-type
value, but those are just ideas to get the brainstorm started.@JoshuaKGoldberg thanks for your continued interest in working on this feature! As you’re starting on the RFC, feel free to discuss anything or ask for early feedback on ideas in this issue, then we can move discussion to the RFC PR once you’ve opened one with a concrete proposal.
Thank you for the ping.
Yes, I will champion.
In most cases, people write
disable
comments to disable existing errors, different fromno-unused-vars
, so I think that autofix will not be annoying them.