react/jsx-space-before-closing
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-space-before-closing": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
<Hello/>
<Hello firstname="John"/><Hello />
<Hello firstName="John" /><Hello />
<Hello firstName="John" />
<Hello
firstName="John"
lastName="Smith"
/><Hello/>
<Hello firstname="John"/>
<Hello
firstName="John"
lastName="Smith"
/>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
react/jsx-space-before-closing
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-space-before-closing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow adjacent inline elements not separated by whitespace.
Require or prevent a new line after jsx elements and expressions.
Enforce React components to have a shouldComponentUpdate method
Enforce or disallow spaces inside of curly braces in JSX attributes and expressions