最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JSX reactjsx-curly-spacing IntelliJ - Stack Overflow

programmeradmin2浏览0评论

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.

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


I have this

I want this

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.

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


I have this

I want this

Share Improve this question edited Aug 9, 2017 at 21:32 Dave Newton 160k27 gold badges260 silver badges308 bronze badges asked Aug 9, 2017 at 21:18 simPodsimPod 13.6k18 gold badges97 silver badges147 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 10

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

This option affects JSX braces as well as Angular interpolations

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.

发布评论

评论列表(0)

  1. 暂无评论