javascript - JSHint error: "E001 - Bad option" - Stack Overflow

I'm working on some ES6 javascript code, and linter-jshint keeps throwing this error. I tried look

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
Add a ment  | 

3 Answers 3

Reset to default 1

Here 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

相关推荐

  • javascript - JSHint error: "E001 - Bad option" - Stack Overflow

    I'm working on some ES6 javascript code, and linter-jshint keeps throwing this error. I tried look

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信