disallowSpaceBeforeComma

Disallows spaces before commas

Types: Boolean or Object

Values:

  • Boolean: true to disallow any spaces before any comma
  • Object: "allExcept" array of exceptions
    • "sparseArrays" to allow spaces in place of absent values in sparse arrays

Example

"disallowSpaceBeforeComma": true
"disallowSpaceBeforeComma": {"allExcept": ["sparseArrays"]}
Valid for mode true
var a, b;
Invalid for mode true
var a ,b;
[a, b, , , c]
Valid for mode {"allExcept": ["sparseArrays"]}
[a, b, , , c]
Invalid for mode {"allExcept": ["sparseArrays"]}
[a , b , , , c]
Rule source
Test source