blob: dd3a2ed2c070077abc19c3149f36fe3caa249e51 [file] [edit]
40 columns |
>>> Unsplit.
if (o case 1 || 2 && 3 ) {}
<<< 3.7
if (o case 1 || 2 && 3) {}
>>> Nested as subpattern.
if (o case 1 && ( 2 || 3 ) ) {}
<<< 3.7
if (o case 1 && (2 || 3)) {}
>>> Chain of same logic operator all split together.
if (object case first || second || third || fourth) {;}
<<< 3.7
if (object
case first ||
second ||
third ||
fourth) {
;
}
>>> Chains of different logic operators split separately.
if (object case first && second || third && fourth && fifth && sixth) {;}
<<< 3.7
if (object
case first && second ||
third &&
fourth &&
fifth &&
sixth) {
;
}
>>> Chains of different logic operators split separately.
if (object case first && second && third && fourth || fifth && sixth) {;}
<<< 3.7
if (object
case first &&
second &&
third &&
fourth ||
fifth && sixth) {
;
}
>>> Multiple split variables as logic operands.
if (object case SomeVeryLongTypeName anAlsoLongVariableName || AnotherLongTypeName anotherLongVariableName) {;}
<<< 3.7
if (object
case SomeVeryLongTypeName
anAlsoLongVariableName ||
AnotherLongTypeName
anotherLongVariableName) {
;
}
>>> Don't indent subsequent `||` operands when split inside a map key.
var {key: longOperand2 || longOperand2 || longOperand3} = value;
<<< 3.7
var {
key:
longOperand2 ||
longOperand2 ||
longOperand3,
} = value;
>>> Don't indent subsequent `&&` operands when split inside a map key.
var {key: longOperand2 && longOperand2 && longOperand3} = value;
<<< 3.7
var {
key:
longOperand2 &&
longOperand2 &&
longOperand3,
} = value;