Question

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?

Was it helpful?

Solution 2

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!

OTHER TIPS

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

jshint: {
    options: {
        jshintrc: '.jshintrc' // relative to Gruntfile
    }
}

First, never touch anything in node_modules. In fact, set your editor and whatever else to not search/list that folder.

Second, you should look at the valid options for jshint: http://jshint.com/docs/options/#quotmark

Third, edit your .myApp/.jshintrc file with the valid option you want. Pick single or double quotes and stick with that throughout your project. Thats why it complains.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top