madskristensen / WebEssentials2013

Visual Studio extension
http://vswebessentials.com
Other
944 stars 251 forks source link

Can't parse config file: .jshintrc SyntaxError: Unexpected token #1986

Open samvedna opened 8 years ago

samvedna commented 8 years ago

jshint

i am getting the following error when i try to run jshint in the command prompt. My .jshintrc file looks like as follows: { "bitwise": true, "browser": true, "curly": true, "eqeqeq": true, "esnext": true, "latedef": true, "noarg": true, "node": true, "strict": true, "undef": true, "unused": true, "globals": { "angular": false } }

things tried:- tried changing the advanced settings of visual studio from utf-8 to western european codeset 1852. i couldn't find any other solution to my problem as i am using proper json format for my file. Please help

broccoliarchy commented 8 years ago

I had the same error message. I thought it was because there was a space in the file path, but removing that didn't help. As a workaround, you can add options inline:

grunt.initConfig({
  jshint: {
    options: {
      curly: true,
      eqeqeq: true,
      eqnull: true,
      browser: true,
      globals: {
        jQuery: true
      },
    },
    uses_defaults: ['dir1/**/*.js', 'dir2/**/*.js'],
    with_overrides: {
      options: {
        curly: false,
        undef: true,
      },
      files: {
        src: ['dir3/**/*.js', 'dir4/**/*.js']
      },
    }
  },

https://github.com/gruntjs/grunt-contrib-jshint#specifying-jshint-options-and-globals

jt000 commented 8 years ago

This looks like it is a grunt-contrib-jshint issue. I'm able to repro without WebEssentials installed