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

Error: Column start (x) greater than line length (0) #249

Closed
mzahor opened this issue May 13, 2016 · 5 comments
Closed

Error: Column start (x) greater than line length (0) #249

mzahor opened this issue May 13, 2016 · 5 comments
Labels

Comments

@mzahor
Copy link

mzahor commented May 13, 2016

Version

4.0.0

Issue

Constantly getting this error when editing js files:


Error: Column start (11) greater than line length (0)
    at Object.rangeFromLineNumber (/Users/mzahor/.atom/packages/linter-jscs/node_modules/atom-linter/lib/index.js:194:11)
    at /Users/mzahor/.atom/packages/linter-jscs/src/linter-jscs.js:184:33
    at Array.map (native)
    at Object.lint (/Users/mzahor/.atom/packages/linter-jscs/src/linter-jscs.js:179:39)
    at promises.push.Promise.then._this.emitter.emit.linter (/Users/mzahor/.atom/packages/linter/lib/linter-registry.js:63:26)
    at /Users/mzahor/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (/Users/mzahor/.atom/packages/linter/lib/linter-registry.js:60:18)
    at /Users/mzahor/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/mzahor/.atom/packages/linter/lib/editor-linter.js:80:22
    at /Users/mzahor/.atom/packages/linter/lib/helpers.coffee:23:18

Screenshot:
image

Also getting this error, not sure it's related to this issue:
image

@Arcanemagus
Copy link
Member

@mzahor Are you able to share a JS file that triggers this, as well as the relevant configuration file?

The error should be reported to node-jscs, and for that matter the Column start (x) greater than line length (y) error is a bug there as well, but I can help you minimize it down for an easy bug to report over there 😉.

Uploading a zip file like this would be ideal.

@Arcanemagus
Copy link
Member

@eviljoe, @kfwerf, and @alexmt as you have all 👍 this issue, I'm assuming you are seeing issues like this as well. The above instructions apply equally as well to you, but can you please file an issue of your own as often these bugs are unique since the error above is just a generic "the linter gave a range that is impossible" message.

So far I know there are issues with the validateNewlineAfterArrayElements rule, as well as the combination of requireSemicolons and requirePaddingNewLinesAfterBlocks together.

@mzahor
Copy link
Author

mzahor commented May 14, 2016

@Arcanemagus attaching zip with source code and .jscsrc as you asked.
jscs-4.0.0-issue.zip

@Arcanemagus
Copy link
Member

The only column start bug I could find was related to this:
.jscsrc:

{
  "disallowPaddingNewlinesInBlocks": true,
  "requirePaddingNewLineAfterVariableDeclaration": true
}

foo.js:

let foo = 42;
function bar() {

  let foobar = 42;
}

The crashing error seems to be able to be reduced down to this:
.jscsrc:

{
  "disallowUnusedParams": true,
  "requirePaddingNewLineAfterVariableDeclaration": true
}

foo.js:

let foo = false;
function bar($foobar) {}

I'll file issues on node-jscs referencing this and we'll see what the actual issue is.

@Arcanemagus
Copy link
Member

Closing as fixed in jscs-dev/node-jscs#2252.

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

No branches or pull requests

2 participants