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

Column start greater than Error #689

Closed
ghost opened this issue Sep 9, 2016 · 27 comments
Closed

Column start greater than Error #689

ghost opened this issue Sep 9, 2016 · 27 comments

Comments

@ghost
Copy link

ghost commented Sep 9, 2016

Error

Column start greater than line length

eslint errors_censored

Similar Issues

I've searched for similar issues here and here but can't seem to figure this out.

Reproduce

@ghost
Copy link
Author

ghost commented Sep 9, 2016

I ran the following command:

./node_modules/.bin/eslint src *.js --quiet

and got the following output:

The react/require-extension rule is deprecated. Please use the import/extensions rule from eslint-plugin-import instead.

Might be something in my .eslintrc file as related to this issue

@Arcanemagus
Copy link
Member

Looking into this, btw for future reference: You can attach zip files directly in GitHub now 😉.

@Arcanemagus
Copy link
Member

So interestingly you should be getting a Error running ESLint Error: EPERM: operation not permitted, write due to that message you posted above. atom/atom#12504 is where working around that limitation is being tracked.

You can work around that by adding "react/require-extension": 0 to your "rules" section of your .eslintrc.

@Arcanemagus
Copy link
Member

After turning that rule off so it will even run, I'm not able to reproduce the error you are seeing with the files you provided 😕.

Can you try turning that rule off as described above and then trying to reproduce this locally again?

@Arcanemagus
Copy link
Member

@vadim since you 👍 this issue, can you file a new issue, with the same set of files @baldwmic provided (eg. foo.js, package.json, .eslintrc.js)? It's highly unlikely you are hitting the exact same issue.

@ghost
Copy link
Author

ghost commented Sep 9, 2016

@Arcanemagus i've tried adding "react-require-extension": 0 to my "rules" in .eslintrc and i'm still encountering the same error in the same javascript file 😢

Strangely enough, I don't see a Error running ESLint Error: EPERM: operation not permitted, write

@Arcanemagus
Copy link
Member

Hmmm, are you seeing it on the file in your project, or in an isolated folder containing just the 3 files you linked?

If you add "root": true to the .eslintrc file does it change anything? It's possible the rule causing the error is coming from a parent .eslintrc file.

@IanVS
Copy link
Member

IanVS commented Sep 9, 2016

@baldwmic are you getting any linting errors? Meaning, not the big red boxes, but an actual eslint rule error?

@digitalcatnip
Copy link

@IanVS I'm experiencing this issue constantly while writing code - it's generating eslint errors because the code isn't fully completed when I stop typing. The most frequent error is "missing semicolon" because as I said, I haven't finished the line yet. The other error would be missing import because I haven't actually imported the file for the new code yet.

This just started happening about 2 days ago, and it's incredibly annoying so let me know what you need to help repro.

screen shot 2016-09-09 at 1 59 10 pm

@IanVS
Copy link
Member

IanVS commented Sep 9, 2016

What is the error you are getting two lines above the semi? HLOChatMessage()

@Arcanemagus
Copy link
Member

@digitalcatnip When you see that message can you immediately save the file, then save it again to see if it triggers the error again? If so can you file a new issue, as generally each of these invalid range errors are unique.

@IanVS
Copy link
Member

IanVS commented Sep 9, 2016

@digitalcatnip in your new issue, can you provide the file which is causing the error? As small of a file as possible, if you could.

@ghost
Copy link
Author

ghost commented Sep 9, 2016

@Arcanemagus @IanVS

New Steps

I've taken a few steps to help suss out whether this is an issue specific to my project or to atom and/or eslint.

Isolated Dependencies

  1. Added the "rules": { "react/require-extension": 0, } workaround to .eslintrc file
  2. Modified the JavaScript file to have zero imports from other files.
  3. Added the files as a separate, isolated project folder in Atom.

Error

While editing the single JavaScript file in Atom, here is what I encounter:

atom_linter

Notes

  • .eslintrc file has "rules": { "react/require-extension": 0, } workaround
  • there are zero eslint rule errors when I begin editing the file
  • the Column start greater than line length error still appears

Reproduce

  1. Download the zipped files
    I'm using
  2. cd ~/Downloads && unzip project.zip
  3. npm install
  4. Add Project Folder of the unzipped files using Atom
  5. Edit the file.js using Atom

@Arcanemagus
Copy link
Member

The error showing in your latest GIF there is a duplicate of #687. Your original image though shows Column start (12) greater than line length (7), which would have to be a bug in a different rule.

@ghost
Copy link
Author

ghost commented Sep 9, 2016

@Arcanemagus ahh i shouldn't have assumed the column and line length numbers were irrelevant to the issue 😞

So there might be two different bugs at play?

@IanVS
Copy link
Member

IanVS commented Sep 9, 2016

Yes, it seems that linter-eslint has become much more sensitive to errors in ESLint rules that report incorrect column numbers. We are fixing the ESLint rules as we find them, but first we have to figure out which rules are reporting the incorrect errors.

If you can run your original file with the eslint cli and let us know what errors you get (copy the output from eslint), that would be very helpful.

@Arcanemagus
Copy link
Member

Arcanemagus commented Sep 9, 2016

Yep, just like @digitalcatnip's is quite possibly a different one as well 😛.

I'm not sure how, but it seems the upgrade to atom-linter@8 from atom-linter@5 is catching a lot more errors, even though the code checking them is essentially the same. It means the base linters (ESLint here) can be made better, but it does mean a bit of a rough time till those bugs are fixed.

@Arcanemagus
Copy link
Member

To provide a bit more context: This linter uses the rangeFromLineNumber function from atom-linter. When it is fed a range it checks it against the file to see if it's valid and throws an error if it isn't. In the case of your original message somehow ESLint reported a message with a character of 13, on a line with only 8 characters in it. (The error message is 0-indexed, like Atom's internal coordinates)

@ghost
Copy link
Author

ghost commented Sep 9, 2016

@IanVS @Arcanemagus

When I run

./node_modules/.bin/eslint file.js

with the same .eslintrc file I got no output.

I tried removing the "react/require-extension": 0, rule and got The react/require-extension rule is deprecated. Please use the import/extensions rule from eslint-plugin-import instead.

@IanVS
Copy link
Member

IanVS commented Sep 9, 2016

@baldwmic and yet when you open file.js in Atom, you get the errors you posted in your screenshot?

You're not using the global eslint in your linter-eslint config are you, by any chance? Anything else you can do to help find the ESLint error that's causing the problems would be very helpful.

@ghost
Copy link
Author

ghost commented Sep 9, 2016

Here's my Atom linter-eslint settings:

screen shot 2016-09-09 at 15 42 09

so I think the answer is no I'm not using the global eslint.

@dmueller39
Copy link

I was getting errors due to this: eslint/eslint#7088, eslint/eslint#7086.

@lmj0011
Copy link

lmj0011 commented Sep 10, 2016

line_length

error is still happening even after updating to [email protected]: #687

reverting to [email protected] doesn't produce this bug

@dmueller39
Copy link

Here's a PR to expose underlying errors: #694

@IanVS
Copy link
Member

IanVS commented Sep 10, 2016

@lmj0011, the only thing fixed in eslint 3.5.0 is the no-multiple-empty-lines rule. The one you're seeing is not from that rule.

@dmueller39, great idea, I'll review and merge ASAP.

@purplecones
Copy link

Has this been resolved? I have the linter-eslint 7.3.0 package installed and I get this error as well.

@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 [email protected] 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!

@AtomLinter AtomLinter locked and limited conversation to collaborators Sep 12, 2016
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

6 participants