简体   繁体   English

JSCS行要长,当其不行时

[英]JSCS line to long, when its not

I'm using JSCS with the airbnb preset (looked at switching to eslint for felt harder to get the style we wanted). 我正在使用带有airbnb预设的JSCS(看起来是切换到eslint,因为很难获得我们想要的样式)。

JSCS throw this error JSCS抛出此错误

    maximumLineLength: Line must be at most 100 characters at ./src/AbstractClient.es6 :
     1 |define(['underscore',
--------^
     2 |    'backbone',
     3 |    'som/models/Model',],

Line 1 is not more than 100 charaters, fact if I add a ')' to the line it stops complaining (starts complaing elsewhere). 第一行不超过100个字符,事实上,如果我在行中添加“)”,它将停止抱怨(开始在其他地方抱怨)。

I've googled and have not found anything like this. 我已经用谷歌搜索了,还没有找到这样的东西。 Currently, I have removed the line length check but would like to add it back in. 目前,我已经删除了行长检查,但想重新添加。

Apparently, the indentation of arrays is not excluded from the maximumLineLength, 显然,maximumLineLength不排除数组的缩进,

More information found here: https://github.com/jscs-dev/node-jscs/issues/424 在此处找到更多信息: https : //github.com/jscs-dev/node-jscs/issues/424

For now, wrap your code with 现在,用

// jscs:disable
... code here
// jscs:enable

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

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