disallowSpacesInsideBrackets

Disallows space after opening square bracket and before closing. Reports on all on brackets, even on property accessors. Use disallowSpacesInsideArrayBrackets to exclude property accessors.

Types: Boolean or Object

Values: true for strict mode, or "allExcept": [ "[", "]" ] ignores closing brackets in a row.

Example

"disallowSpacesInsideBrackets": true

// or

"disallowSpacesInsideBrackets": {
    "allExcept": [ "[", "]", "{", "}" ]
}
Valid for mode true
var x = [[1]];
var x = a[1];
Valid for mode { allExcept": [ "[", "]", "{", "}" ] }
var x = [ [1] ];
var x = [ { a: 1 } ];
Invalid
var x = [ [ 1 ] ];
Rule source
Test source