Reputation: 1160
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!
Upvotes: 13
Views: 3925
Reputation: 1
In VS Code Settings search for "prettier" Default Formatter and change it to Prettier ESLint (maybe you will need to install it i dont remember)
and checkout for eslint rule "react/jsx-tag-spacing"
Upvotes: 0
Reputation: 614
Use language mode javascriptreact, instead of javascript
Upvotes: 0
Reputation: 866
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.
Upvotes: 2