Bertuz
Bertuz

Reputation: 2576

how to disable the "laxcomma" check?

I'm using SublimeLintern package, but I'm experiencing some issues. I would like to toggle that "laxcomma" warning that appears each time I save my files: I do prefer putting my commas at the beginning of each row

{
  "item1": val1
  ,"item2": val2
  ,"item3": val3
}

Hence, I tried to look for some piece of documentation that explained how to enable or disable each check. I bumped into this that should explain what I need. So, my SublimeLinter.sublime-settings is now like this:

{
    "jshint_options": {
        "laxcomma": false
    }
}

but it doesn't seem to be working. I still see that bothering warning! What's wrong with my settings?

Upvotes: 10

Views: 6010

Answers (2)

mikermcneil
mikermcneil

Reputation: 11271

Bizarre. For me, the issue was that I had a .jshintrc file in the local directory of my project. Despite the fact that laxcomma wasn't being overridden there EITHER, apparently it just completely overrides your jshint_options (or maybe it does a top-level extend and doesn't recursively merge the config objects...)

The solution was to add (to the local .jshintrc file):

"laxcomma": true

Upvotes: 4

Cody Codes
Cody Codes

Reputation: 27

The word "lax" means not strict or severe; if you want to put your commas at the beginning of each line, try setting "laxcomma" to true:

{
    "jshint_options": {
        "laxcomma": true
    }
}

Upvotes: 1

Related Questions