| 40 columns | |
| >>> split in condition |
| var map = {1: 1, if (veryLongConditionExpression || anotherPart) 2: 2}; |
| <<< |
| var map = { |
| 1: 1, |
| if (veryLongConditionExpression || |
| anotherPart) |
| 2: 2 |
| }; |
| >>> without else on one line |
| var map = {1: 1, if (c) 2: 2, 3: 3}; |
| <<< |
| var map = {1: 1, if (c) 2: 2, 3: 3}; |
| >>> with else on one line |
| var map = {1: 1, if (c) 2: 2 else 2: 2}; |
| <<< |
| var map = {1: 1, if (c) 2: 2 else 2: 2}; |
| >>> split collection before if |
| var map = {if (c) somewhatLongThingHere: 1}; |
| <<< |
| var map = { |
| if (c) somewhatLongThingHere: 1 |
| }; |
| >>> one line in multi-line |
| var map = {veryLongThingThatForcesASplit, if (c) 2: 2, 3: 3}; |
| <<< |
| var map = { |
| veryLongThingThatForcesASplit, |
| if (c) 2: 2, |
| 3: 3 |
| }; |
| >>> one line in multi-line with else |
| var map = {veryLongThingThatForcesASplit: 1, if (c) 2: 2 else 2: 2, 3: 3}; |
| <<< |
| var map = { |
| veryLongThingThatForcesASplit: 1, |
| if (c) 2: 2 else 2: 2, |
| 3: 3 |
| }; |
| >>> long then branch forces split |
| var map = {1: 1, if (condition) veryLongThingThatForcesASplit: 2, 3: 3}; |
| <<< |
| var map = { |
| 1: 1, |
| if (condition) |
| veryLongThingThatForcesASplit: 2, |
| 3: 3 |
| }; |
| >>> long then branch forces both to split |
| var map = {1: 1, if (condition) veryLongThingThatForcesASplit: 2 else 2: 2, 3: 3}; |
| <<< |
| var map = { |
| 1: 1, |
| if (condition) |
| veryLongThingThatForcesASplit: 2 |
| else |
| 2: 2, |
| 3: 3 |
| }; |
| >>> long else branch forces both to split |
| var map = {1: 1, if (condition) 2: 2 else veryLongThingThatForcesASplit: 2, 3: 3}; |
| <<< |
| var map = { |
| 1: 1, |
| if (condition) |
| 2: 2 |
| else |
| veryLongThingThatForcesASplit: 2, |
| 3: 3 |
| }; |
| >>> trailing comma |
| var map = {if (c) 2: 2,}; |
| <<< |
| var map = { |
| if (c) 2: 2, |
| }; |
| >>> spread list inside if stays on one line if it fits |
| var map = {if (c) ...{1: 1, 2: 2}}; |
| <<< |
| var map = { |
| if (c) ...{1: 1, 2: 2} |
| }; |
| >>> spread list inside if formats like block if it splits |
| var map = {if (c) ...{1: 1, 2: 2,}}; |
| <<< |
| var map = { |
| if (c) ...{ |
| 1: 1, |
| 2: 2, |
| } |
| }; |
| >>> both spreads split if then must |
| var map = {if (c) ...{1: 1, 2: 2,} else ...{1: 1, 2: 2}}; |
| <<< |
| var map = { |
| if (c) ...{ |
| 1: 1, |
| 2: 2, |
| } else ...{ |
| 1: 1, |
| 2: 2 |
| } |
| }; |
| >>> both spreads split if else must |
| var map = {if (c) ...{1: 1, 2: 2} else ...{1: 1, 2: 2,}}; |
| <<< |
| var map = { |
| if (c) ...{ |
| 1: 1, |
| 2: 2 |
| } else ...{ |
| 1: 1, |
| 2: 2, |
| } |
| }; |
| >>> a split collection that isn't spread wraps and indents |
| var map = {if (c) {1: 1,2: 2,}}; |
| <<< |
| var map = { |
| if (c) |
| { |
| 1: 1, |
| 2: 2, |
| } |
| }; |
| >>> a split collection that isn't spread wraps and indents |
| var map = {if (c) {1: 1,2: 2,} else thing: 3}; |
| <<< |
| var map = { |
| if (c) |
| { |
| 1: 1, |
| 2: 2, |
| } |
| else |
| thing: 3 |
| }; |
| >>> a split collection that isn't spread wraps and indents |
| var map = {if (c) thing: 0 else {1: 1,2: 2,}}; |
| <<< |
| var map = { |
| if (c) |
| thing: 0 |
| else |
| { |
| 1: 1, |
| 2: 2, |
| } |
| }; |
| >>> lambda inside then |
| var map = {if (c) k: () { body; }}; |
| <<< |
| var map = { |
| if (c) |
| k: () { |
| body; |
| } |
| }; |
| >>> lambda inside else |
| var map = {if (c) thing: 1 else k: () { body; }}; |
| <<< |
| var map = { |
| if (c) |
| thing: 1 |
| else |
| k: () { |
| body; |
| } |
| }; |
| >>> nested if splits outer |
| var map = {if (c) if (d) thing: 1}; |
| <<< |
| var map = { |
| if (c) |
| if (d) thing: 1 |
| }; |
| >>> split collection before body |
| var map = {if (c) fairlyLongThingHere: 1}; |
| <<< |
| var map = { |
| if (c) fairlyLongThingHere: 1 |
| }; |
| >>> just split outer if |
| var map = {if (condition) if (another) longThingThatIsLong: 1}; |
| <<< |
| var map = { |
| if (condition) |
| if (another) longThingThatIsLong: 1 |
| }; |
| >>> split inside condition |
| var map = {if (veryLongCondition + thatNeedsToSplit) thing: 1}; |
| <<< |
| var map = { |
| if (veryLongCondition + |
| thatNeedsToSplit) |
| thing: 1 |
| }; |
| >>> split entry inside if |
| var map = { if (condition) veryLongKeyExpression: andAVeryLongValueExpression}; |
| <<< |
| var map = { |
| if (condition) |
| veryLongKeyExpression: |
| andAVeryLongValueExpression |
| }; |