简体   繁体   English

如何配置jshint不给我错误“以前断线”?

[英]How do I configure jshint to not give me the error “Bad line breaking before”?

It's giving me the error "Bad line breaking before ','" because I have code like the following 它给了我错误“之前坏线断线”,因为我有如下代码

var one = 1
  , two = 2
  , three = 3
  ;

If I put the , at the end of the line instead of the beginning of the next, it doesn't complain. 如果我把,在该行,而不是我下月初结束,它不会抱怨。 But I want to code this way. 但我想以这种方式编码。 Is there a way I can make it not show this warning? 有没有办法让它不显示这个警告?

I looked though JSHint's options but there isn't anything pertaining to this error. 我查看了JSHint的选项,但没有任何与此错误相关的内容。

As mentioned in the comments of the laxbreak answer, laxcomma option should actually be used for this particular situation (it has been implemented in the meantime). 正如laxbreak答案的评论中所提到的, laxcomma选项实际上应该用于这种特殊情况(它已在此期间实施)。 See http://jshint.com/docs/options/ for details. 有关详细信息,请参见http://jshint.com/docs/options/

laxbreak = true is the option to set. laxbreak = true是要设置的选项。

You can find the option on the main page of JSHint site as "About unsafe line breaks" . 您可以在JSHint网站的主页上找到“关于不安全的换行符”的选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM