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.

Allow "reportUnusedDisableDirectives" option to "error"

See original GitHub issue

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

github_iconTop GitHub Comments

3reactions
eslint-deprecated[bot]commented, Feb 20, 2020

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.

2reactions
platinumazurecommented, Dec 24, 2019

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.

Read more comments on GitHub >

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

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