react/jsx-curly-spacing
eslint-plugin-react
Safe autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-curly-spacing": "error",
},
},
];Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
<Hello name={ firstname } />;
<Hello name={ firstname} />;
<Hello name={firstname } />;<Hello name={ firstname } />;
<Hello name={ firstname} />;
<Hello name={firstname } />;
<Hello>{ firstname }</Hello>;<Hello name={firstname} />;
<Hello name={ firstname} />;
<Hello name={firstname } />;<Hello name={firstname} />;
<Hello name={{ firstname: 'John', lastname: 'Doe' }} />;
<Hello name={
firstname
} />;
<Hello>{firstname}</Hello>;
<Hello>{ firstname }</Hello>;
<Hello>{
firstname
}</Hello>;<Hello name={firstname} />;
<Hello name={{ firstname: 'John', lastname: 'Doe' }} />;
<Hello name={
firstname
} />;
<Hello>{firstname}</Hello>;
<Hello>{
firstname
}</Hello>;<Hello name={ firstname } />;
<Hello name={ {firstname: 'John', lastname: 'Doe'} } />;
<Hello name={
firstname
} />;
<Hello>{ firstname }</Hello>;
<Hello>{firstname}</Hello>;
<Hello>{
firstname
}</Hello>;Examples from the ESLint documentation.
react/jsx-curly-spacing
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-curly-spacing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce consistent linebreaks in curly braces in JSX attributes and expressions
Enforce or disallow spaces around equal signs in JSX attributes
Enforce closing tag location for multiline JSX
Enforce proper position of the first property in JSX
Enforce closing bracket location in JSX