Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error parsing config file when running jshint

Tags:

jshint

I always get the following output when trying to run 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 config file is quite trivial, I copied it directly from the jshint docs:

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

Any ideas to be able to get this working would be appreciated.

like image 599
1800 INFORMATION Avatar asked Dec 19 '22 23:12

1800 INFORMATION


1 Answers

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

File -> Advanced Save Options

And changed Encoding accordingly:

enter image description here

like image 88
1800 INFORMATION Avatar answered Dec 28 '22 04:12

1800 INFORMATION