Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing option for grunt jshint

I have a web app created by yeoman webapp generator, that has this structure:

myApp
    app
    node_modules
        grunt
        grunt-contrib-jshint
    test

I try to change the quotmark: "single" option for jshint to quotmark: true to turn off the error for double quote. I try to set it in:

  • myApp/.jshintrc
  • myApp/node_modules/grunt-contrib-jshint/.jshintrc

However, it seems that my change is not registered when I run grunt: grunt jshint

Do I have to make that change anywhere else?

like image 358
bizi Avatar asked Dec 02 '13 21:12

bizi


2 Answers

How does your Gruntfile look like? You should have something like

jshint: {
    options: {
        jshintrc: '.jshintrc' // relative to Gruntfile
    }
}
like image 143
bevacqua Avatar answered Nov 13 '22 11:11

bevacqua


I found out the problem I am having. I was having this:

var myVar = [
  {
    "name": "a name"   //  jshint warning: Mixed double and single quotes.
  }
];

The correct option I should set is "quotmark": false instead of "quotmark": true to turn off the quote mark checking, even though I don't see why it should be an issue in my case.

The .jshintrc file to set this option is: myApp/.jshintrc

Thanks everyone for your help. I really appreciate it!

like image 1
bizi Avatar answered Nov 13 '22 10:11

bizi