Report an error for eslint-disable-line comments that span multiple lines #10334
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
breaking
This change is backwards-incompatible
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
Projects
The version of ESLint you are using.
v4.19.1
The problem you want to solve.
It's possible to write a
disable-line
directive comment that spans multiple lines, like this:This is potentially confusing because it's not clear which "line" the directive comment is referring to. In fact, the current behavior is that ESLint ignores the directive comment entirely and doesn't disable anything.
Your take on the correct solution to problem.
ESLint should report an error when an
eslint-disable-line
oreslint-disable-next-line
directive comment spans multiple lines, to inform the user that their directive isn't doing anything so that the user can fix the problem.This was discussed in #9745 (comment) when block comment support for
disable-line
directives was added. The sentiment at the time was that we couldn't make multi-linedisable-line
directives an error then since it would be a breaking change, so we decided to warn about them at the time with the plan to make them an error in the next major release.The text was updated successfully, but these errors were encountered: