linter-jshint icon indicating copy to clipboard operation
linter-jshint copied to clipboard

Invalid position given by 'W002'

Open ramki99 opened this issue 8 years ago • 3 comments

JSHint returned a point that did not exist in the document being edited. Rule: W002 Requested start point: 374:18

Debug information:

Atom version: 1.16.0
linter-jshint version: v3.1.4
JSHint version: jshint v2.9.5
Hours since last Atom restart: 53.5
Platform: darwin
Current file's scopes: [
  "source.js",
  "meta.method-call.js",
  "meta.arguments.js",
  "meta.method-call.js",
  "meta.arguments.js",
  "meta.method-call.js",
  "meta.arguments.js",
  "meta.method-call.js",
  "meta.arguments.js",
  "punctuation.definition.function.body.end.bracket.curly.js"
]
linter-jshint configuration: {
  "executablePath": "",
  "lintInlineJavaScript": false,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}

ramki99 avatar Jul 05 '17 21:07 ramki99

Is your code indented by tabs?

Arcanemagus avatar Jul 05 '17 22:07 Arcanemagus

Mine is. I got the same error. I like tabs better because everybody can have it her/his way with them. IMHO tabs are cleaner.

lukidoescode avatar Aug 29 '17 16:08 lukidoescode

Thanks for the confirmation @m3t4lukas.

This is almost certainly another case of https://github.com/jshint/jshint/issues/3151. There are reports that if you set your indent property of your JSHint configuration to 1 this issue can be worked around. If you don't have a .jshintrc file the following should work:

{
  "indent": 1
}

If anyone is directed here and isn't using tabs to indent please provide code to reproduce this so an issue can be filed on JSHint to get this fixed there.

Arcanemagus avatar Aug 29 '17 17:08 Arcanemagus