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

Invalid position given by 'W110'

Open aderowbotham opened this issue 6 years ago • 2 comments

JSHint returned a point that did not exist in the document being edited. Rule: W110 Requested point: 1105:57

my .jshintrc file:

{
  "undef": true,
  "unused": true,
  "latedef": false,
  "browser": true,
  "predef": [
    "$",
    "angular",
    "Chart",
    "FastClick",
    "Foundation",
    "jAlert",
    "jConfirm",
    "jPrompt",
    "jQuery",
    "window",
    "console"
  ],
  "globals": {
    "console": true,
    "window": true
  }
}

Debug information:

Atom version: 1.25.0
linter-jshint version: v3.1.6
JSHint version: jshint v2.9.5
Hours since last Atom restart: 0
Platform: darwin
Current file's scopes: [
  "source.js",
  "meta.function.js",
  "meta.parameters.js",
  "punctuation.definition.parameters.end.bracket.round.js"
]
linter-jshint configuration: {
  "executablePath": "",
  "lintInlineJavaScript": false,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}

aderowbotham avatar Mar 29 '18 15:03 aderowbotham

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.

Arcanemagus avatar Mar 29 '18 17:03 Arcanemagus

Adding "indent": 1 does indeed prevent the problem from occurring.

aderowbotham avatar Mar 29 '18 18:03 aderowbotham