Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Column start (1) greater than line length (0) #687

Closed
bigslycat opened this issue Sep 8, 2016 · 25 comments
Closed

Column start (1) greater than line length (0) #687

bigslycat opened this issue Sep 8, 2016 · 25 comments

Comments

@bigslycat
Copy link

bigslycat commented Sep 8, 2016

2016-09-08 13-00-38

Error: Column start (1) greater than line length (0)
  at Object.rangeFromLineNumber (/home/cat/.atom/packages/linter-eslint/node_modules/atom-linter/lib/index.js:179:11)
  at /home/cat/.atom/packages/linter-eslint/lib/main.js:142:33
  at Array.map (native)
  at /home/cat/.atom/packages/linter-eslint/lib/main.js:125:27

Atom v1.10.1, Ubuntu 16.10

@slackday
Copy link

slackday commented Sep 8, 2016

I get the same error on Atom v.1.10.2, Mac OSX 10.10.5 after updating this plugin to v7.3.0 today.

Don't really know where to start looking for source of this error or what other info might be helpful.

@dev-pro-alexander-subota

Same issue, Ubuntu 14.04, Atom 1.9.7, updated to plugin v7.3.0

@IanVS
Copy link
Member

IanVS commented Sep 8, 2016

I am not seeing any problems with Atom 1.10.1, mac OSX, and linter-eslint 7.3.0.

For those of you having this problem, can you try restarting Atom and confirm that it still occurs?

If so, some more details would be great. e.g. does this happen on every file you try to open, or only certain files?

@dev-pro-alexander-subota
Copy link

dev-pro-alexander-subota commented Sep 8, 2016

@IanVS It happens when user write the code and code have unclosed brackets.
scn-20160908-0160c75

Just updated Atom to 1.10.2, issue is still presents

@rockerest
Copy link

Also just updated to 1.10.2 and this issue persists.

For the record, I don't have to type anything, it happens on initial load of the editor, too.
Adding a blank line anywhere causes it. I don't think it has to do with unclosed braces.

firstopen

@rockerest
Copy link

Just restarted to test, and the issue still persists after a reboot.

Running Xubuntu 16.04 (Ubuntu 16.04 base).

@halcarleton
Copy link

I'm getting this error even after restarting atom. I had a similar issue with linter-jshint before I switched to linter-eslint. This latest update is the first time I have seen this issue with linter-eslint.

Here's a gif of the easiest way I have found to recreate the issue:
recreating issue

Here is my .eslintrc.json file.

linter-eslint 7.3.0
eslint        3.4.0
Ubuntu        16.04

@Arcanemagus
Copy link
Member

Looking into this now.

@Arcanemagus
Copy link
Member

@halleycarleton Your specific case is due to no-multiple-empty-lines reporting a column of 2 on blank lines... which don't have that many columns.

@dev-pro-alexander-subota and @rockerest it looks like you are both hitting the same thing as well.

@bigslycat I'm not sure what you are hitting as you provided no information necessesary to reproduce the error (file that shows it + config for eslint + version used), but I'm guessing you are hitting the same problem.

I'll get a nice clean reproduction case and file this over on ESLint.

@IanVS
Copy link
Member

IanVS commented Sep 8, 2016

@Arcanemagus Perhaps we should at least add a safety check to make sure the column number is valid and avoid throwing an error?

@rockerest
Copy link

rockerest commented Sep 8, 2016

@Arcanemagus Can (probably) confirm that it's the no-multiple-empty-lines rule, causing other errors doesn't result in the popup, it looks like it's only errors when the line length is 0.

Update for anyone coming here later: It's not just lines where the length is zero, but any rule checking (apparently) at the end of the line. Have seen a bunch of places where it's referencing column 51 when there are only 50 columns, etc.

@Arcanemagus
Copy link
Member

Arcanemagus commented Sep 8, 2016

Filed over there, turns out this has been broken since eslint@1.8.0, I have no idea why this wasn't blowing up on everyone long ago 😕.

@lmj0011
Copy link

lmj0011 commented Sep 9, 2016

reverting back to linter-eslint@7.2.4 is what I'm doing until a patch is implemented

@Arcanemagus Arcanemagus changed the title Errors after update Column start (1) greater than line length (0) Sep 9, 2016
@Arcanemagus
Copy link
Member

ESLint v3.5.0 includes the fix by @IanVS for this bug, update the local copy in your projects and you should stop seeing this error 😉.

@sk22
Copy link

sk22 commented Sep 10, 2016

Nope, still facing the same issue.

> .\node_modules\.bin\eslint --version
v3.5.0
Error: Column start (1) greater than line length (0)
    at Object.rangeFromLineNumber (C:\Users\samuel\.atom\packages\linter-eslint\node_modules\atom-linter\lib\index.js:179:11)
    at C:\Users\samuel\.atom\packages\linter-eslint\lib\main.js:142:33
    at Array.map (native)
    at C:\Users\samuel\.atom\packages\linter-eslint\lib\main.js:125:27

@sk22
Copy link

sk22 commented Sep 10, 2016

I don't even see eslint's path in the error trace. So why should eslint be responsible for the issue, or is the trace incomplete?

@scholtzm
Copy link

ESLint itself provides the invalid marker, e.g. column position 1 for line with 0 characters.

@sk22
Copy link

sk22 commented Sep 10, 2016

But shouldn't the problem have been fixed with 3.5.0?

@IanVS
Copy link
Member

IanVS commented Sep 10, 2016

@22sk, would you mind linting the file which is throwing the error using the eslint cli, and post the results? It could well be another rule that is causing your problems. The only one fixed in ESLint so far is no-multiple-empty-lines, but there are likely others as well.

@sk22
Copy link

sk22 commented Sep 10, 2016

@IanVS The message appears like completely randomly, if any line length changes. The CLI's output looks just as it should. No thrown errors or such.

@Arcanemagus
Copy link
Member

@22sk did you restart Atom after updating eslint in your project? It loads eslint per path, and won't update the loaded version until you restart Atom.

@jokeyrhyme
Copy link

I've restarted and I'm no longer getting the error related to no-multiple-empty-lines. Yay! Thanks!

I did see it for one other error, but I can't remember how I reproduced it. When I figure it out, I'll report it against upstream ESLint.

@sk22
Copy link

sk22 commented Sep 12, 2016

@Arcanemagus I did...

@scholtzm
Copy link

scholtzm commented Sep 12, 2016

FWIW, ESLint v3.5.0 fixes the issue on my end.

edit. After using Atom for a while, I'm still getting this error occasionally, but with a different (higher) column numbers than before. I'm not able to reproduce this consistently though.

I guess #689 is the error I'm seeing now.

screen shot 2016-09-12 at 17 02 55

screen shot 2016-09-12 at 17 15 57

@Arcanemagus
Copy link
Member

v7.3.1 is released which should show the offending error in the message shown to you.

As the bug causing the originally reported issue has been fixed in eslint@3.5.0 I'm locking this issue. Please file a new issue here if you need help tracking down where the problem is, or preferably over on ESLint as you should now be able to tell what the offending rule is 😉.

Thanks everyone for taking the time to help track this down and report it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests