Feature suggestion: Make report-unused-disable-directives report unknown rules #9647
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
Tell us about your environment
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 toerror
. I tried putting decorator above the doc block, but thenlines-around-comment
complained. So I figured out in such cases I want it to be quiet. But I made a typo. I addeds
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:
Recently i tried
--report-unused-disable-directives
What did you expect to happen?
I'd expect for ESLint to tell me that there's no rule
lines-around-comments
(ending withs
) 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.
The text was updated successfully, but these errors were encountered: