AtomLinter / linter-jshint

Atom linter plugin for JavaScript, using jshint.
147 stars 39 forks source link

Invalid position given by 'E020' #676

Open jeffpdavies opened 5 years ago

jeffpdavies commented 5 years ago

JSHint returned a point that did not exist in the document being edited. Rule: E020 Requested point: 120:20

Debug information:

Atom version: 1.32.2
linter-jshint version: v3.1.9
JSHint version: jshint v2.9.6
Hours since last Atom restart: 0.1
Platform: linux
Current file's scopes: [
  "source.js",
  "comment.block"
]
linter-jshint configuration: {
  "executablePath": "",
  "lintInlineJavaScript": false,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}
jeffpdavies commented 5 years ago

Hi,

I am receiving the above error in line 1 which is a comment line.

Arcanemagus commented 5 years ago

Assuming that you are indenting your file with tabs this is 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.