Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree

From: Konstantin Kharlamov <[email-masked]>
Date: Fri, 18 Apr 2025 17:06:34 +0300

Given this correctly indented code:

    const a = cond1 ? 1
      : cond2 ? 2
      : cond3 ? 3
      : 4;

if you reindent it, it turns into:

    const a = cond1 ? 1
      : cond2 ? 2
        : cond3 ? 3
          : 4;

Basically, for every colon it increases indentation. This is different
from other c-like languages (it's is indented as the first form
instead), and it's also different from Python. The "tree-indentation"
is not readable, so there's a reason other modes indent it as the
first example. Would it be possible to change in typescript mode as
well?