Subject: Re: bug#9151: js-mode indentation doesn't recognize brace-less function expressions

From: Jakub Ječmínek <[email-masked]>
Date: Mon, 03 Jun 2024 19:48:01 +0000

Knut Olav Bøhmer <[email-masked]> writes:

> Right:
> const something = () =>
>       indent_like_this();
> Wrong:
> const something = () =>
> not_indent_like_this();

This indents correctly for me.

Štěpán Němec <[email-masked]> writes:

> In JavaScript, the following is a valid function definition:
>
> function foo ()
>     a.somewhat().complicated()
>     .computation()
>
> but `js-mode' currently indents it like this:
>
> function foo ()
> a.somewhat().complicated()
>     .computation()

I know virtually nothing about JavaScript but your example function
doesn't seem valid.  If you add curly braces and set `js-chain-indent'
to t then it works fine.