simPod
simPod

Reputation: 13466

JSX react/jsx-curly-spacing IntelliJ

I'm using IDEA 2017.2. I need to setup JSX codestyle so there are spaces between curly braces like { event.series }. However, it autoformats it to {event.series}

I have these checked in Javascript -> Spaces.

spaces for objects etc checked

Where can I set it up so it complies with ESLint's react/jsx-curly-spacing set to "always"?


I have this

I have this

I want this

I want this

Upvotes: 4

Views: 1298

Answers (2)

Arsen Khachaturyan
Arsen Khachaturyan

Reputation: 8330

For IntelliJ IDEA 2020, you need to go to File -> Settings -> Editor -> Code Style -> JavaScript and in Spaces tab find section called Within.

If you want to make the below statement look:

<div>Hello, ${ to } from ${ from.join( ',' ) }</div>

then check the Interpolation expressions checkmark.

enter image description here

Upvotes: 1

lena
lena

Reputation: 93778

In 2017.2, it is Settings | Editor | Code Style | JavaScript | Spaces, Other/Within interpolation expressions:

enter image description here

This option affects JSX braces as well as Angular interpolations

Upvotes: 10

Related Questions