all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dražen <kermit666@gmail.com>
To: 26001@debbugs.gnu.org
Subject: bug#26001: js-mode: JSX indentation after fat-arrow attribute
Date: Mon, 06 Mar 2017 14:40:56 +0000	[thread overview]
Message-ID: <CADg_27_MhD6X4LcocLZQiDefdGBTFemq-5Ku7DGfPJt9MiumNQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]

As mentioned in
https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380 , there
seems to be a bug in the way js-mode (at least the folks there pointed me
at js-mode) indents JSX JavaScript.

When I'm doing a map with JSX syntax I'm getting:

render() {
    const messages = this.state.messages.map(
        message => <Message key={message.id}
        text={message.text}
        mine={message.mine} />
    );    return messages;
}

I'd ideally expect something like:

render() {
    const messages = this.state.messages.map(
        message => <Message key={message.id}
                            text={message.text}
                            mine={message.mine} />
    );    return messages;
}

It's even odder when I try to leave the argument to the arrow function in
the line above:

render() {
    const messages = this.state.messages.map(message =>
                                             <Message key={message.timestamp}
                                             text={message.text}
                                             mine={message.mine} />
                                            );    return messages;
}

For this second case, I'd hope to get:

render() {
    const messages = this.state.messages.map(message =>
        <Message key={message.timestamp}
                 text={message.text}
                 mine={message.mine} />
    );    return messages;
}

(I get such results if I wrap the return expression in parentheses)

[-- Attachment #2: Type: text/html, Size: 20159 bytes --]

             reply	other threads:[~2017-03-06 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 14:40 Dražen [this message]
2019-06-05  2:57 ` bug#26001: js-mode: JSX indentation after fat-arrow attribute Jackson Ray Hamilton
2019-06-05  9:33   ` Dražen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADg_27_MhD6X4LcocLZQiDefdGBTFemq-5Ku7DGfPJt9MiumNQ@mail.gmail.com \
    --to=kermit666@gmail.com \
    --cc=26001@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.