Allow "reportUnusedDisableDirectives" option to "error"
See original GitHub issueThe version of ESLint you are using.
6.8.0
The problem you want to solve.
I’d like to prevent (i.e., error on) unused directives via my configuration (rather than the CLI).
Your take on the correct solution to problem.
I can error on unused directives via --report-unused-disable-directives
. However, for errors to be shown in the IDE, it would be easier to allow the reportUnusedDisableDirectives
configuration option to be set to error
. Currently, it can only be set to true
, which translates to warn
.
Are you willing to submit a pull request to implement this change?
Yes.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Top Results From Across the Web
eslint-comments/no-unused-disable - mysticatea
So this rule is now using two public APIs as an alternative hack. ... from reportUnusedDisableDirectives errors to eslint-comments/no-unused-disable errors.
Read more >Command Line Interface - ESLint - Pluggable JavaScript Linter
This results in a new reported error for the unused directive if the report-unused-disable-directives option is used. --report-unused-disable-directives example.
Read more >Pulling Results out of Options - Rust By Example
Pulling Result s out of Option s. The most basic way of handling mixed error types is to just embed them in each...
Read more >A Bit On ESLint Configuration In A React Project - Medium
You can also enlist the CLI tool to specify configuration options, ... reportUnusedDisableDirectives allows you to see where the inline ...
Read more >@nrwl/linter:eslint | Nx
Options can be configured in project.json when defining the executor, or when invoking it. ... Fixes linting errors (may overwrite linted files).
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
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.
Hi @obweger. Just as a note, if you haven’t configured any rules to warn, you could use
--max-warnings 0
to ensure that ESLint terminates with a failure status code if unused disable directive warnings are generated in your lint run.