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

Report an error for eslint-disable-line comments that span multiple lines #10334

Closed
not-an-aardvark opened this issue May 10, 2018 · 1 comment
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

Comments

@not-an-aardvark
Copy link
Member

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:

/* eslint-disable-next-line
  foo,
  bar,
  baz
*/

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 or eslint-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-line disable-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.

@not-an-aardvark not-an-aardvark added enhancement This change enhances an existing feature of ESLint core Relates to ESLint's core APIs and features breaking This change is backwards-incompatible evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion tsc agenda This issue will be discussed by ESLint's TSC at the next meeting labels May 10, 2018
@not-an-aardvark not-an-aardvark added this to Needs discussion in v5.0.0 May 10, 2018
@not-an-aardvark
Copy link
Member Author

This issue was accepted in today's TSC meeting.

@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion tsc agenda This issue will be discussed by ESLint's TSC at the next meeting labels May 10, 2018
@not-an-aardvark not-an-aardvark moved this from Needs discussion to Accepted, ready to implement in v5.0.0 May 10, 2018
@not-an-aardvark not-an-aardvark moved this from Accepted, ready to implement to Ready to merge in v5.0.0 May 10, 2018
v5.0.0 automation moved this from Ready to merge to Done May 11, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Nov 8, 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 Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
No open projects
v5.0.0
  
Done
Development

No branches or pull requests

1 participant