question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--report-unused-disable-directives should be autofixable

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
btmillscommented, Apr 11, 2021

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.

4reactions
mysticateacommented, Jul 14, 2019

Thank you for the ping.

Yes, I will champion.

In most cases, people write disable comments to disable existing errors, different from no-unused-vars, so I think that autofix will not be annoying them.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found