Closed
Description
I use ternary expressions a lot, as part of a more functional "assign-once" style. But I always have to manually adjust my indentation and make sure to never accidentally auto-indent the parts of my code that use them. Here's the indentation I would like to use:
// single-line values
const foo = condition ?
trueValue :
falseValue;
nextLineOfCode();
// alternate style
const foo = condition
? trueValue
: falseValue;
nextLineOfCode();
// multi-line values
const foo = condition ? (
moreComplex(
multiLineStatement
)
) : (
otherMultilineStatement(
ohNo
)
);
However, the current implementation indents this code like so:
// single-line values
const foo = condition ?
trueValue :
falseValue;
nextLineOfCode();
// alternate style
const foo = condition
? trueValue
: falseValue;
nextLineOfCode();
// multi-line values
const foo = condition ? (
moreComplex(
multiLineStatement
)
) : (
otherMultilineStatement(
ohNo
)
);