disallowCommaBeforeLineBreak

Disallows commas as last token on a line in lists.

Type: Boolean, Object

Values:

  • true for default behavior (strict mode, comma on the same line)
  • Object:
    • 'allExcept' array of exceptions:
      • 'function' ignores objects if one of their values is a function expression

JSHint: laxcomma

Example

"disallowCommaBeforeLineBreak": true
Valid for true
var x = {
    one: 1
    , two: 2
};
var y = {three: 3, four: 4};
Invalid
var x = {
    one: 1,
    two: 2
};
Valid for {"allExcept": ["function"]}
var x = {
    one: 1,
    two: function() {}
};
Rule source
Test source