Change Request: error by default for unused disable directives #18665
Labels
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
ESLint version
9.6.0
What problem do you want to solve?
As of #17879, the default value of
linterOptions.reportUnusedDisableDirectives
is"warn"
. That means that unused disable directives do get reported by default - but unless the user sets a--max-warnings
, those reports don't cause a build failure / failing status code.What do you think is the correct solution?
I'd like ESLint to
"error"
by default when there's an unused disable directive. It's very rare that a user would want those directives in the first place.Following #16696 -> #16882, it seems like an odd discrepancy that ESLint would use warnings by default in its options.
Note that this would be a breaking change for a future major version of ESLint.
Participation
Additional comments
The paper trail I could find leading up to the default value being
"warn"
, in chronological order:reportUnusedDisableDirectives
config option by default #15466There are deep discussions in the RFC about whether to use
"error"
or"warn
by default -in particular, eslint/rfcs#100 (comment) - but it looks to me that they're partially overlapped with the discussions of what to make as a breaking change. I'm not sure how much of that is open to discussion - especially now that the option has been in the wild and enabled by default.The text was updated successfully, but these errors were encountered: