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

no-multiple-empty-lines reports invalid column #7086

Closed
Arcanemagus opened this issue Sep 8, 2016 · 1 comment
Closed

no-multiple-empty-lines reports invalid column #7086

Arcanemagus opened this issue Sep 8, 2016 · 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 bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@Arcanemagus
Copy link

What version of ESLint are you using?

eslint@3.4.0

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

The default parser

Please show your full configuration:

.eslintrc.json:

{
  "rules": {
    "no-multiple-empty-lines": 2
  }
}

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

Ran ESLint on the following code:

'use strict';


Note, files used in this test are available here: linter-eslint_GH687.zip

What did you expect to happen?

An error reported on line 4 (5?), column 1.

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

PS C:\Temp\github\linter-eslint_GH687> .\node_modules\.bin\eslint .\foo.js

C:\Temp\github\linter-eslint_GH687\foo.js
  4:2  error  More than 2 blank lines not allowed  no-multiple-empty-lines

✖ 1 problem (1 error, 0 warnings)

Note the column of 2, which doesn't exist.

I tested this on eslint@1.10.3, eslint@2.0.0, and eslint@2.13.1 as well as the reported eslint@3.4.0 with identical results.

Moving all the way down to eslint@0.9.0, where this rule was introduced, results in the following:

PS C:\Temp\github\linter-eslint_GH687> .\node_modules\.bin\eslint .\foo.js

.\foo.js
  1:0  error  Use the function form of "use strict"  global-strict
  1:0  error  Strings must use doublequote           quotes
  4:1  error  Unexpected blank line at end of file   eol-last
  5:0  error  Multiple blank lines not allowed       no-multiple-empty-lines

✖ 4 problems

So I'm guessing that something broke when updating this rule for the 1-based indexing for eslint@1.

If there is any further information necessary please let me know! Originally reported by several people over in AtomLinter/linter-eslint#687, although I'm not sure why it didn't show up earlier as this should have been breaking for a very long time there.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 8, 2016
@IanVS
Copy link
Member

IanVS commented Sep 8, 2016

Looks like the column location changed in 13fd818#diff-0f6472c36e2e4d88a28a92f9b5148206R85. It seems that it should be 0 instead of 1 there, since context.report() expects a 0-based column location (http://eslint.org/docs/developer-guide/working-with-rules#contextreport). Seems to be a bug to me.

@IanVS IanVS added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 8, 2016
@nzakas nzakas closed this as completed in 2a3f699 Sep 9, 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

3 participants