I have this issue for a while. We have ESlint and it forbids us to add space before self-closing JSX-tag, but when I format .jsx file within VS Code it inserts it. How may I disable it?
There is screenshot with the problem:
Thanks!
Use language mode javascriptreact, instead of javascript
To my knowledge there is no such formatting option within the javascript.format
options. But you can always look into extensions for this kind of job.
A lot of people use Prettier these days, but it is opinionated and there is no guarantee it will work well with all your ESLint options. It has an ESLint integrationn though, so maybe you want to have a look at this.
You can also have a look at react-beautify, which seems to have an option for this. But I am not familiar with this extension.
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