react/jsx-child-element-spacing
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-child-element-spacing": "error",
},
},
];Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
<div>
Here is a
<a>link</a>
</div><div>
<b>This text</b>
is bold
</div><div>
Spacing is
{' '}
<a>explicit</a>
</div><div>
Lack of spacing is{/*
*/}<a>explicit</a>
</div>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-child-element-spacing
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-child-element-spacing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require or prevent a new line after jsx elements and expressions.
Disallow adjacent inline elements not separated by whitespace.
Enforce React components to have a shouldComponentUpdate method