最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to disable the "laxcomma" check? - Stack Overflow

programmeradmin0浏览0评论

I'm using SublimeLintern package, but I'm experiencing some issues. I would like to toggle that "laxma" warning that appears each time I save my files: I do prefer putting my mas 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": {
        "laxma": false
    }
}

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

I'm using SublimeLintern package, but I'm experiencing some issues. I would like to toggle that "laxma" warning that appears each time I save my files: I do prefer putting my mas 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": {
        "laxma": false
    }
}

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

Share Improve this question asked Sep 18, 2013 at 21:01 BertuzBertuz 2,5763 gold badges30 silver badges62 bronze badges 4
  • Have you looked at lines 284 and 285 of /Packages/SublimeLinter/sublimelinter/modules/libs/jshint/jshint.js? You might want to set laxbreak and laxma to false. – AGS Commented Sep 19, 2013 at 1:58
  • Yep! I've tried both, but nothing happens – Bertuz Commented Sep 19, 2013 at 10:42
  • 1 May you try this out on your SBT2 sublimelinter.sublime-settings file and tell me if it works properly? In case it works: may you paste a gist here? Thanks – Bertuz Commented Sep 19, 2013 at 10:44
  • Is this still relevant? I do get warning for ma at the beginning of each line rather than end! But code seems to work fine on pretty much all browsers! – Sushil Lakra Commented Aug 27, 2021 at 7:22
Add a ment  | 

2 Answers 2

Reset to default 4

Bizarre. For me, the issue was that I had a .jshintrc file in the local directory of my project. Despite the fact that laxma wasn't being overridden there EITHER, apparently it just pletely 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):

"laxma": true

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

{
    "jshint_options": {
        "laxma": true
    }
}
发布评论

评论列表(0)

  1. 暂无评论