I'm working on some ES6 javascript code, and linter-jshint
keeps throwing this error.
I tried looking up all JSHint options. At first I added {"esversion": 6}
to a .jshintrc file on my user directory. This was when the error started to appear. Then I tried going for the deprecated {"esnext": true}
. The error just changed to another one, so I went back.
This option should work, I don't get why it's showing this error. It's a valid option, isn't it?
By the way, I'm using Atom.
I'm working on some ES6 javascript code, and linter-jshint
keeps throwing this error.
I tried looking up all JSHint options. At first I added {"esversion": 6}
to a .jshintrc file on my user directory. This was when the error started to appear. Then I tried going for the deprecated {"esnext": true}
. The error just changed to another one, so I went back.
This option should work, I don't get why it's showing this error. It's a valid option, isn't it?
By the way, I'm using Atom.
Share Improve this question edited Nov 23, 2015 at 21:00 Felix Kling 818k181 gold badges1.1k silver badges1.2k bronze badges asked Nov 23, 2015 at 15:41 Fabio BrachtFabio Bracht 4231 gold badge4 silver badges13 bronze badges 4- 1 Are you using the latest version of JSHint?... – War10ck Commented Nov 23, 2015 at 16:11
- If you're referring to JSHint as an Atom package, yes. It's up to date. – Fabio Bracht Commented Nov 23, 2015 at 16:35
- I had almost the same E0001 error but with 'extract' instead of 'esversion' with a fresh installed atom, jshint, linter. And the error was ing from errors in my .jshintrc file – Mic Commented Nov 25, 2015 at 10:21
- @Mic How did you resolved the error? Could you post a snippet of your .jshintrc? Maybe I'm just formatting it wrong? – Fabio Bracht Commented Nov 25, 2015 at 17:29
3 Answers
Reset to default 1Here is my working .jshintrc file, I had a wrong property error in it, giving the same kind of message:
{
"predef": [ "$", "jQuery", "text", "$p", "window", "document", "console", "parent" ],
"curly": true,
"eqeqeq": true,
"funcscope": true,
"futurehostile": true,
"latedef": true,
"nonbsp": true,
"notypeof": true,
"shadow": "outer",
"singleGroups": true,
"undef": true,
"unused": true,
"debug": true,
"scripturl": true,
"-W079": true
}
Something useful.
If you Ctrl + Alt + Cmd + L
(on a Mac)
Atom is reloaded, and take the last changes into account.
I had one line with
// jshint ignore:line //and wanted to add some more information in the ment
removing the additional ment fixed the error.
Check package.json
.
Stumbled across this error because package.json
had:
{
jshintConfig": {
"extends": "./node_modules/jsgreat/es6/.jshintrc"
}
}
Which is invalid, extends
can only be used in a .jshintrc
file.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745457539a4628557.html
评论列表(0条)