react/jsx-tag-spacing
eslint-plugin-react
Safe autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-tag-spacing": "error",
},
},
];Enforce whitespace in and around the JSX opening and closing brackets
<App/ >
<input/
>
<Provider>< /Provider><Hello/>
<Goodbye></Goodbye><Hello/>
<Hello firstname="John"/><App/>
<input/>
<Provider></Provider><Hello/ >
<Goodbye>< /Goodbye><Hello />
<Hello firstName="John" />
<Hello
firstName="John"
lastName="Smith"
/>Examples from the ESLint documentation.
react/jsx-tag-spacing
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-tag-spacing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow multiple spaces between inline JSX props
Disallow missing parentheses around multiline JSX
Disallow when this.state is accessed within setState
Enforce maximum of props on a single line in JSX
Lifecycle methods should be methods on the prototype, not class fields