2

I am in the process of upgrading an Ember application from version 2.4.3 to 2.9.1. The application builds successfully, but I get a list of 42 versions of the following JSHint error; each starting with a different file name

unit/services/tracker-test.js: line 0, col 0, Incompatible values for the 'esversion' and 'esnext' linting options. (0% scanned).

My .jshintrc file contains

...
"esnext": true,
"esversion": 6,
...

What is coursing the errors?

Emil Bækdahl
  • 119
  • 1
  • 10
  • If you're using Microsoft's VSCode JSHint, make sure it's updated. This used to be a bug, before April 20, on their Issues. https://github.com/Microsoft/vscode-jshint/issues/18 – Frederik Spang Nov 01 '16 at 10:30
  • I am not using VSCode even though the error seems to be identical with mine. – Emil Bækdahl Nov 01 '16 at 10:34

2 Answers2

6

According to this jshint docs, esnext is deprecated:

Warning This option has been deprecated and will be removed in the next major release of JSHint. Use esversion: 6 instead.

It is meaningless to set both "esnext": true option and "esversion": 6 option.

ykaragol
  • 6,139
  • 3
  • 29
  • 56
  • 2
    Thanks for the answer. I tried to remove the `esnext` option, but it did not help. The fact is that I was not aware of the `.jshintrc` located in `/tests/` with the same options as the one in the root directory. I changed the options, and now everything works. – Emil Bækdahl Nov 01 '16 at 17:25
  • Yes, there are another `.jshintrc` files at `tests` and `blueprints` directories. – ykaragol Nov 01 '16 at 17:49
1

So I realised that a .jshintrc file also exists in the tests/ directory. Ykaragold wrote that the esnext option is deprecated, so removing this option from both .jshintrc and tests/.jshintrc worked for me.

Emil Bækdahl
  • 119
  • 1
  • 10