victorporof / Sublime-JSHint

JSHint Gutter for Sublime Text 2 and 3 via node.js
https://github.com/victorporof/Sublime-JSHint
682 stars 71 forks source link

Bad option: "esversion" #123

Closed evolutionxbox closed 8 years ago

evolutionxbox commented 8 years ago

Whilst writing my lovely code, I find that my code fails tests! "This cannot stand!", I cried.

In the gutter, a curious warning triangle can be seen:

screen shot 2016-01-16 at 23 09 29

Accompanied by some more nefarious text in the footer:

screen shot 2016-01-16 at 23 09 51

Does there exist such a person of whom can help me with my predicament?


Options

.jshintrc (project root)

{
  "esversion": 6,
  "devel": true,
  "browser": true
}

.jshintrc (JS Hint Gutter)

  "browser": true,
  "esnext": true,
  "globals": {},
  "globalstrict": true,
  "quotmark": true,
  "undef": true,
  "unused": true,
  "devel": true
}
victorporof commented 8 years ago

Take "esversion" out of your .jshintrc (project root).

evolutionxbox commented 8 years ago

If I do that, I am left with a plethora of ES6 related errors when I run npm run test (jshint command line).

Surely esversion is a valid jshint option?

victorporof commented 8 years ago

Hmm, it would seem that error is generated by jshint itself. Have you tried npm update inside the scripts folder to update to the latest version?

evolutionxbox commented 8 years ago

Hmmm, my jshint is on version 2.9.1...

Either JSHint Gutter complains about having the esversion and without it, JSHint complains about using let and const.

victorporof commented 8 years ago

Can you get jshint to generate the exact same error when used outside this plugin? If so, please file a bug there.

evolutionxbox commented 8 years ago

I'll try that tonight. If you hear nothing, it's likely I've forgotten... Thanks, @victorporof

evolutionxbox commented 8 years ago

@victorporof, I get the following error when I remove the esversion from .jshintrc:

src/index.js: line 3, col 1, 'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
src/index.js: line 6, col 3, 'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
src/index.js: line 8, col 3, 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
src/index.js: line 12, col 3, 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
src/index.js: line 16, col 3, 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
src/index.js: line 17, col 3, 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

JSHint v2.9.1