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

max-len sometimes fails to report errors when ignoreComments is true #6564

Closed
not-an-aardvark opened this issue Jun 29, 2016 · 2 comments
Closed
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 bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@not-an-aardvark
Copy link
Member

What version of ESLint are you using? 2.13.1

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

Please show your full configuration:

{
  "rules": {
    "max-len": [2, 20, {"ignoreComments": true}]
  }
}

What did you do? Please include the actual source code causing the issue.

// This commented line has the same length as the line below
var foo = 'this line is longer than the maximum line length'

What did you expect to happen?

I expected ESLint to report an error on the second line, since that line is longer than 20 characters.

What actually happened? Please include the actual, raw output from ESLint.

ESLint did not report any errors.

This bug only seems to occur when there is a long commented line somewhere in the file, and there is a non-commented line of exactly the same length later in the file.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 29, 2016
@platinumazure platinumazure added bug ESLint is working incorrectly rule Relates to ESLint's core rules 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 Jun 29, 2016
@platinumazure
Copy link
Member

Definitely seems like a bug. Thanks for the report!

@not-an-aardvark
Copy link
Member Author

I think I have a fix for this; I'm reading the docs at the moment to figure out how to test it/make a PR correctly.

not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Jun 30, 2016
not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Jun 30, 2016
not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Jun 30, 2016
@nzakas nzakas 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 labels Jun 30, 2016
not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Jul 3, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 Feb 6, 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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

4 participants