Requires all lines to be at most the number of characters specified
Types: Integer
or Object
Values:
Integer
: lines should be at most the number of characters specifiedObject
:value
: (required) lines should be at most the number of characters specifiedtabSize
: (default: 1
) considered the tab character as number of specified spacesallExcept
: (default: []
) an array of conditions that will exempt a lineregex
: allows regular expression literals to break the rulecomments
: allows comments to break the ruleurlComments
: allows comments with long urls to break the rulefunctionSignature
: allows function definitions to break the rulerequire
: allows require expressions to break the ruleallowRegex
: deprecated use allExcept: ["regex"]
insteadallowComments
: deprecated use allExcept: ["comments"]
insteadallowUrlComments
: deprecated use allExcept: ["urlComments"]
insteadJSHint: maxlen
"maximumLineLength": 40
var aLineOf40Chars = 123456789012345678;
var aLineOf41Chars = 1234567890123456789;
"maximumLineLength": { "value": 40, "allExcept": [ "functionSignature" ] }
var f = function(with, many, _many_, arguments) { .... };
let f = x => x * x * x * x * x * x * x * x;
(function(foo, bar, baz, quux, cuttlefish) {
function namesNaamesNaaamesNaaaames() {
...
}
})();
const longNameIgnoredAsWell = (a, b) => a * b;
class X { myLongMethodName(withPossiblyManyArgs) { ... } };
function x() { // valid
return "function_bodies_are_not_protected";
}