GNU bug report logs - #76704
30.1; Indentation of braces on separate line in js-ts-mode

Previous Next

Package: emacs;

Reported by: Fabian Brosda <f.brosda <at> gmx.de>

Date: Mon, 3 Mar 2025 04:33:03 UTC

Severity: minor

Found in version 30.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Fabian Brosda <f.brosda <at> gmx.de>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>, juri <at> linkov.net, Eli Zaretskii <eliz <at> gnu.org>
Cc: 76704 <at> debbugs.gnu.org
Subject: bug#76704: 30.1; Indentation of braces on separate line in js-ts-mode
Date: Wed, 02 Apr 2025 10:51:05 +0200
Hi Vincenzo,

> For switch body indentation now possible to use js-switch-indent-offset as in
> js-mode.

Testing this, the results are different in js-mode and js-ts-mode.  js-mode
applies the offset only if the brace is on the same line, while
js-ts-mode applies it only, if the brace is on a separate line.  I
updated the gist, and used js-switch-indent-offset = 2, to distinguish
it from the regular indentation.

> Can you please try it again?

I also tested in a couple of projects and found one difference when
using ternary operators and putting the whole expression in parenthesis.
I also added it to the gist.  Note, that only the combination of
parenthesis and ternary operator is different, the other two cases are
the same.

But otherwise I could not find any more differences and the original
case with braces on separate lines also works very well :-)

Fabian





This bug report was last modified 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.