简体   繁体   中英

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).

JSCS throw this error

    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).

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,

More information found here: https://github.com/jscs-dev/node-jscs/issues/424

For now, wrap your code with

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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