Subject: bug#77803: tsx-ts-mode: wrong indentation for variables declarations

From: Konstantin Kharlamov <[email-masked]>
Date: Mon, 14 Apr 2025 18:41:42 +0300

Given this TypeScript snippet:

    const a = 1,
          b = 2;
    var c = 3,
        d = 4;

…both b and d are expected to be indented to `typescript-ts-mode-indent-offset`
(2 by default). This both makes logical sense and is the behavior in another
editor VSCode.

Instead it gets indented to the length of `const` and `var` + space.

I'd note a separate problem: if you have this code:

    const a = 1,
      b = 2,
          c = 3;

…and you try to indent `c`, instead of getting indented to the previous line it
keeps being at "const + space" length.