maximumLineLength

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 specified
  • Object:
    • value: (required) lines should be at most the number of characters specified
    • tabSize: (default: 1) considered the tab character as number of specified spaces
    • allExcept: (default: []) an array of conditions that will exempt a line
      • regex: allows regular expression literals to break the rule
      • comments: allows comments to break the rule
      • urlComments: allows comments with long urls to break the rule
      • functionSignature: allows function definitions to break the rule
      • require: allows require expressions to break the rule
    • allowRegex: deprecated use allExcept: ["regex"] instead
    • allowComments: deprecated use allExcept: ["comments"] instead
    • allowUrlComments: deprecated use allExcept: ["urlComments"] instead

JSHint: maxlen

Example

"maximumLineLength": 40
Valid
var aLineOf40Chars = 123456789012345678;
Invalid
var aLineOf41Chars = 1234567890123456789;

Example for allExcept functionSignature

"maximumLineLength": { "value": 40, "allExcept": [ "functionSignature" ] }
Valid
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) { ... } };
Invalid
function x() { // valid
    return "function_bodies_are_not_protected";
}
Rule source
Test source