I use prettier for formatting my code. How can I configure prettier to add a space depending on curly braces in react code?
Current code:
<AdminPanel
theme={myTheme}
dataProvider={dataProvider}
authProvider={authProvider}
history={history}
/>
Expected result:
<AdminPanel
theme={ myTheme }
dataProvider={ dataProvider }
authProvider={ authProvider }
history={ history }
/>
The option bracket-spacing is what you are looking for: bracketSpacing: true
.
https://prettier.io/docs/en/options.html#bracket-spacing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With