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

Invalid position given by 'W069'

Open rafmjr opened this issue 8 years ago • 5 comments

JSHint returned a point that did not exist in the document being edited. Rule: W069 Requested point: 228:51

Debug information:

Atom version: 1.18.0
linter-jshint version: v3.1.5
JSHint version: jshint v2.9.5
Hours since last Atom restart: 4.8
Platform: win32
Current file's scopes: [
  "source.js",
  "meta.switch-statement.js",
  "string.quoted.single.js",
  "punctuation.definition.string.begin.js"
]
linter-jshint configuration: {
  "executablePath": "C:\\Users\\rafam\\AppData\\Roaming\\npm\\node_modules\\jshint\\bin\\jshint",
  "lintInlineJavaScript": true,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}

rafmjr avatar Jul 20 '17 00:07 rafmjr

Does your file use tabs for indentation?

Arcanemagus avatar Jul 20 '17 02:07 Arcanemagus

Yes it does? Should I use spaces instead?

rafmjr avatar Jul 20 '17 04:07 rafmjr

Although that is normally a personal preference, currently there is a major bug with JSHint and how it handles tabs. You can follow the details here: https://github.com/jshint/jshint/issues/3151.

If anyone else is directed to this issue and isn't using tabs to indent your files please file a new issue with a file to reproduce it on the JSHint repo, or file one here and I'll try to help you in getting one filed there where it can be fixed.

Arcanemagus avatar Jul 20 '17 16:07 Arcanemagus

So if it changing to space indentation fixes the problem then I would do it, at least until the bug is fixed. Thanks for the follow-up and you guys keep the work hard.

rafmjr avatar Jul 20 '17 17:07 rafmjr

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
}

Arcanemagus avatar Sep 13 '17 17:09 Arcanemagus