Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Invalid position given by 'W140' #448

Open
cobexer opened this issue Jul 1, 2017 · 2 comments
Open

Invalid position given by 'W140' #448

cobexer opened this issue Jul 1, 2017 · 2 comments
Labels

Comments

@cobexer
Copy link

cobexer commented Jul 1, 2017

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

define('xxx', () => {
	function xxx() {
		let actions = [];
		for (let p of Object.keys({})) {
			actions.push(['set', p, cur[p]]);
		}
		return actions;
	}
	return xxx;
});
{
	"bitwise": true,
	"curly": true,
	"eqeqeq": true,
	"forin": true,
	"freeze": true,
	"futurehostile": true,
	"latedef": true,
	"maxerr": 5000,
	"nocomma": true,
	"nonbsp": true,
	"nonew": true,
	"notypeof": true,
	"singleGroups": true,
	"strict": "implied",
	"undef": true,
	"unused": true,
	"varstmt": true,
	"esversion": 6,
	"trailingcomma": true,
	"-W034": true,
	"browser": true,
	"globals": {
		"define": false,
		"require": false
	}
}

The files are indented using tabs.

Debug information:

Atom version: 1.18.0
linter-jshint version: v3.1.5
JSHint version: jshint v2.9.5
Hours since last Atom restart: 0.3
Platform: linux
Current file's scopes: [
  "source.js",
  "meta.function-call.js",
  "meta.arguments.js",
  "meta.brace.curly.js"
]
linter-jshint configuration: {
  "executablePath": "",
  "lintInlineJavaScript": false,
  "disableWhenNoJshintrcFileInPath": false,
  "scopes": [
    "source.js",
    "source.js-semantic"
  ],
  "jshintFileName": ".jshintrc",
  "jshintignoreFilename": ".jshintignore"
}
@Arcanemagus
Copy link
Member

Arcanemagus commented Jul 2, 2017

Since your file is indented using tabs this is almost certainly another rule hit by jshint/jshint#3151, please follow that issue for updates on when this will get fixed.

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.

Thanks for taking the time to report this!

@Arcanemagus
Copy link
Member

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
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants