Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Make report-unused-disable-directives report unknown rules #9647

Closed
jrencz opened this issue Nov 21, 2017 · 2 comments
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@jrencz
Copy link
Contributor

jrencz commented Nov 21, 2017

Tell us about your environment

  • ESLint Version: 4.11
  • Node Version: 9.2
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint

Please show your full configuration: n/a

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

Long time ago I introduced decorators to my project. It turned out I can't put decorator just above a class if I have require-jsdoc eto to error. I tried putting decorator above the doc block, but then lines-around-comment complained. So I figured out in such cases I want it to be quiet. But I made a typo. I added s at the end of the rule name. But it did help even though not because of what was in the inline comment, rather because the line comment is just there.

Then I copy-pasted this into many more files.
I end up with something like this:

@someDecorator()
// eslint-disable-next-line lines-around-comments
/**
 * ...
 */
class Foo {}

Recently i tried --report-unused-disable-directives

eslint --report-unused-disable-directives someFile.js

What did you expect to happen?
I'd expect for ESLint to tell me that there's no rule lines-around-comments (ending with s) in my config.
It would be super handy (but not required) if it told me there's lines-around-comment and I may have made a typo.

What actually happened? Please include the actual, raw output from ESLint.
ESLint told me: Unused eslint-disable directive (no problems were reported from 'lines-around-comments') which is technically correct but it's misleading to a certain extent.

I suggest --report-unused-disable-directives flag should first report attempts to silence out rules which doesn't exist in the config (for whatever reason: whether it's a typo or the rule was in the config one day and it's not there any more)

I'd like to than @didnotwant for helping me figure out what was actually wrong with my code and inspired me to file this issue.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Nov 21, 2017
@aladdin-add aladdin-add added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Nov 22, 2017
@aladdin-add
Copy link
Member

aladdin-add commented Nov 24, 2017

this was happening when disabling a non-existent rule. related: #9505

@not-an-aardvark
Copy link
Member

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn't get consensus from the team, so I'm closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design -- we can't realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they're worth adding.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 19, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

3 participants