How to add space after/before '{' and '}' in WebStorm?

3.2k views Asked by At

I am a bit familiar with JetBrains products and I know I can set style for the files I am working on. However, I am not able to find where to configure my .tsx file in order to see my desired style. Seems, changes in TypeScript section doesn't change my .tsx file.

As you can see in the following image, I have .tsx file and I want to have space after {, before } and before />. However, my all spaces gets removed after I hit command+option+L.

enter image description here

3

There are 3 answers

0
anstarovoyt On BEST ANSWER

You need the option Within interpolation expressions (works in WS2017.2) in Preferences -> Editor -> Code style -> TypeScript:

Within interpolation expression

2
XPLOT1ON On

GO to Preferences -> Editor -> Code style -> TypeScript. The configuration options are in there although, they won't have all of the preferences you mention but they do have things like Space within braces etc

Webstorm CodeStyle DOCS

0
Semir Hodzic On

On web storm 2021.2 Just go to Preferences -> Editor -> Code style -> TypeScript enter image description here