Error parsing configuration file when running jshint

I always get the following output when trying to start jshint:

C:\Users\foo\Source\
λ jshint -c .glados-jshintrc gulpfile.js
ERROR: Can't parse config file: .glados-jshintrc
Error:SyntaxError: Unexpected token 

My jshint configuration file is pretty trivial, I copied it directly from jshint docs:

{
  "undef": true,
  "unused": true,
  "predef": [ "MY_GLOBAL" ]
}

Any ideas to get this job will be appreciated.

+4
source share
1 answer

I found that the problem was caused by Visual Studio. When I created the jshint configuration file in VS, he created it as UTF-8 with the BOM prefix (byte order mark). This seemed to break the configuration file parser. To fix the problem, I visited the File menu:

File -> Advanced Save Options

And changed the encoding accordingly:

enter image description here

+11
source

Source: https://habr.com/ru/post/1610331/


All Articles