Ternary (?:) formatting (for TypeScript), no align except when nested?

Is there a way to get the following formatting with ?: in TypeScript?

var variable = condition1
 ? result1
 : condition2
 ? result2
 : result3;

All I can seem to get (with no align) is:

var variable = condition1
 ? result1
 : condition2
 ? result2
 : result3;

I can't get the results of the second condition to indent relative to the first.

1
2 comments
Official comment

Hello Eric!

 

Thank you for contacting us.

Currently there's no way to format TS code like this. We have plans to introduce such features in future R# versions.

Thank you.

Gah. I format ternaries like this all the time!

0

Please sign in to leave a comment.