react/jsx-indent-props
eslint-plugin-react
Safe autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-indent-props": "error",
},
},
];// 2 spaces indentation
<Hello
firstName="John"
/>
// no indentation
<Hello
firstName="John"
/>
// 1 tab indentation
<Hello
firstName="John"
/>// 2 spaces indentation
// [2, 2]
<Hello
firstName="John"
/>
<Hello
firstName="John" />
// tab indentation
// [2, 'tab']
<Hello
firstName="John"
/>
// no indentation
// [2, 0]
<Hello
firstName="John"
/>
// aligned with first prop
// [2, 'first']
<Hello
firstName="John"
lastName="Doe"
/>
<Hello
firstName="John"
lastName="Doe"
/>
// …Examples from the ESLint documentation.
react/jsx-indent-props
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-indent-props": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce maximum of props on a single line in JSX
Enforce proper position of the first property in JSX
Enforce or disallow spaces around equal signs in JSX attributes
Disallow multiple spaces between inline JSX props