In self-closing tags (e.g., ), Prettier automatically inserts a space before the closing /. Nevertheless, Prettier itself lacks an explicit setting to toggle this behavior if you wish to eliminate the space before the /.
Prettier can be used in combination with ESLint
In ESLint there is a command called "react/self-closing-comp." To use that command, first you need to install necessary plugins...
For that, use "npm install --save-dev eslint eslint-plugin-html."
Create a .eslintrc file or modify it, if it's already there, by entering the code below...
{ "extends": ["eslint:recommended", "plugin:html/recommended"] , "rules": { "html-self-closing": ["error", { "spaceBeforeSelfClosing": "never" }] } }
Now it should work after pushing... Write to me if there was an error !