Indent JSX expression with indented newline the same way as vanilla JS

This block of code is formatted by IntelliJ auto-formatter:

const jsx = (
<div>
{ some_expression &&
<span>
Some Text
</span>
}
</div>
);

I would like the inner `<span>` to be indented:

const jsx = (
<div>
{ some_expression &&
<span>
Some Text
</span>
}
</div>
);

In the same way that a newline `&&` is indented in vanilla JS:

let result = some_expression
&& other_expression;

Is there an option for this in JSX? Is there any reason JSX shouldn't always format like the latter rather than the current behavior?

1 comment

Not currently possible, please votye for https://youtrack.jetbrains.com/issue/WEB-25338 to be notified on any progress with it

0

Please sign in to leave a comment.