[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40760: 27.0.50; An indentation problem with const and chaining in js
From: |
Marcin Borkowski |
Subject: |
bug#40760: 27.0.50; An indentation problem with const and chaining in js-mode |
Date: |
Mon, 14 Mar 2022 06:10:44 +0100 |
User-agent: |
mu4e 1.1.0; emacs 29.0.50 |
On 2020-04-22, at 11:05, Marcin Borkowski <mbork@mbork.pl> wrote:
> When declaring a const variable which is assigned a value of a long,
> chained expression, the default indentation is wrong (compared to a let
> declaration):
>
> let a = /regex/
> .test('regex hello');
>
> const a = /regex/
> .test('regex hello');
>
> I would expect (and prefer) this:
>
> let a = /regex/
> .test('regex hello');
>
> const a = /regex/
> .test('regex hello');
>
> (checked on emacs -Q)
This is the temporary solution I employed:
(setq js--declaration-keyword-re "\\<\\(let\\|var\\)\\>")
I would suggest turning this variable into a user option.
Best,
PS. Please CC me in any replies, I am not subscribed to bug-gnu-emacs.
--
Marcin Borkowski
http://mbork.pl
- bug#40760: 27.0.50; An indentation problem with const and chaining in js-mode,
Marcin Borkowski <=