Disallows nested ternaries.
Types: Boolean
, Object
Values: true
or an Object that contains a maxLevel
property equal to an integer
indicating the maximum levels of nesting to be allowed.
"disallowNestedTernaries": true
// or
"disallowNestedTernaries": { "maxLevel": 1 }
true
and "maxLevel": 1
var foo = (a === b) ? 1 : 2;
true
, but valid for "maxLevel": 1
var foo = (a === b)
? (a === c)
? 1
: 2
: (b === c)
? 3
: 4;
true
and "maxLevel": 1
var foo = (a === b)
? (a === c)
? (c === d)
? 5
: 6
: 2
: (b === c)
? 3
: 4;