How to prevent VS Code from adding space before self-closing JSX tag?

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.


Use language mode javascriptreact, instead of javascript

enter image description here