在基于WebStorm / IntelliJ的产品中,如何在自动结束标记中的结束标记之前包含空格?
默认设置轮流<ReactComp />
到<ReactComp/>
,这是不合规矩的(一个JSX-空间之前关闭的常用AirBNBs的JavaScript风格指南)。
在基于WebStorm / IntelliJ的产品中,如何在自动结束标记中的结束标记之前包含空格?
默认设置轮流<ReactComp />
到<ReactComp/>
,这是不合规矩的(一个JSX-空间之前关闭的常用AirBNBs的JavaScript风格指南)。
Maybe a little confusingly, the setting is under "HTML" code style and not the JS code style in IntelliJ.
Enable the setting "In empty tag" in Preferences -> Editor -> Code Style -> HTML.
When you do an explicit reformat the space will be added. To ensure that the space is added when autocompleting React components, check the same box in in the Preferences -> Editor -> Code Style -> XML -> Other tab.
Screenshot from 2016-10-12, IntelliJ IDEA 2016.2