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

Invalid position given by 'W117'

Open ozgrozer opened this issue 7 years ago • 2 comments

JSHint returned a point that did not exist in the document being edited. Rule: W117 Requested point: 5:14

Here's a simplified code where I get this error.

var map, marker;

function initialize(charlie) {
	map = new google.maps.Map(document.getElementById("c"), {
		zoom: zoom
	});
}

Debug information:

Atom version: 1.18.0
linter-jshint version: v3.1.5
JSHint version: jshint v2.9.5
Hours since last Atom restart: 5.4
Platform: darwin
Current file's scopes: [
  "source.js",
  "punctuation.terminator.statement.js"
]
linter-jshint configuration: {
  "executablePath": "/usr/local/bin/jshint",
  "lintInlineJavaScript": true,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}

ozgrozer avatar Jul 27 '17 12:07 ozgrozer

This is yet another case of https://github.com/jshint/jshint/issues/3151 as your example code is indented with tabs, please follow that issue for when this will get resolved in JSHint.

If anyone is directed here and isn't using tabs to indent your file 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 27 '17 16:07 Arcanemagus

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