Requires each element in array on a single line when array length is more than passed maximum number or array fills more than one line.
Types: Boolean
, Integer
, Object
Values:
true
: setting this is the same as validating the rule using {maximum: Infinity, ignoreBrackets: false}
Integer
: setting this is the same as validating the rule using {maximum: Integer, ignoreBrackets: false}
Object
:maximum
Integer
specifies the maximum number of elements that a single line array can containignoreBrackets
true
specifies that the [
and ]
brackets can be placed on the same line as the array elements"validateNewlineAfterArrayElements": {
"maximum": 3
}
true
var x = [{a: 1}, [2], '3', 4, 5, 6];
var x = [
{a: 1},
[2],
'3',
4
];
true
var x = [1,
2];
3
var x = [{a: 1}, [2], '3'];
var x = [
1,
2,
3,
4
];
3
var x = [1, 2, 3, 4];
var x = [1,
2,
3];
var x = [
1, 2
];
{maximum: 2, ignoreBrackets: true}
var x = [{a: 1}, [2]];
var x = [1,
2,
3];
{maximum: 2, ignoreBrackets: true}
var x = [1, 2, 3];
var x = [1, 2,
3];
var x = [1,
2, 3];