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

Open
samvedna opened this Issue Jan 24, 2016 · 2 comments

Projects

None yet

3 participants

@samvedna

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

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
jt000 commented Feb 29, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment