javascript - Vim jshint error "bad line breaking before ','" - Stack Overflow

I use jshint.vim and in the code like below I get an error "bad line breaking before ','

I use jshint.vim and in the code like below I get an error "bad line breaking before ','"

var a = 5
  , b = 10;

How can I fix this? I found this question, but I'm not sure how can I use it to fix the problem in Vim. Is there any config file (except .vimrc) where I can set laxbreak or laxma?

I use jshint.vim and in the code like below I get an error "bad line breaking before ','"

var a = 5
  , b = 10;

How can I fix this? I found this question, but I'm not sure how can I use it to fix the problem in Vim. Is there any config file (except .vimrc) where I can set laxbreak or laxma?

Share Improve this question edited May 23, 2017 at 12:32 CommunityBot 11 silver badge asked Jan 15, 2013 at 17:03 evfwcqcgevfwcqcg 16.4k15 gold badges57 silver badges72 bronze badges 2
  • 1 Which jshint.vim file are you using? Does it e with documentation? – gen_Eric Commented Jan 15, 2013 at 17:06
  • 1 I. Must. Resist. The. Urge. To. Downvote. Because. Of. That. Bloody. Leading. Comma. – romainl Commented Jan 15, 2013 at 18:07
Add a ment  | 

2 Answers 2

Reset to default 6

Yes. I often use a leading ma style, and set the following preferences inside ~/.jshintrc:

{  
//...other prefs
laxma  : true,
laxbreak  : true,
//... other prefs
}

If you don't already have a .jshintrc, those two settings enclosed in braces a la JSON will probably do the trick.

I'm not sure about global configurations for the vim implementation, you'd have to consult the docs for that implementation, but you can put

/*jshint laxma:true */

at the top of your source files to set this on a per-file basis

Update

Looks like for the vim implementation you can set the config file using a global variable:

https://github./walm/jshint.vim/pull/3

You can then just create a json file and set laxma:true in it.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745355377a4624084.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信