react/jsx-max-depth
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-max-depth": "error",
},
},
];<App>
<Foo>
<Bar>
<Baz />
</Bar>
</Foo>
</App>// [2, { "max": 1 }]
<App>
<Hello />
</App>
// [2,{ "max": 2 }]
<App>
<Foo>
<Bar />
</Foo>
</App>
// [2, { "max": 3 }]
<App>
<Foo>
<Bar>
<Baz />
</Bar>
</Foo>
</App>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-max-depth
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-max-depth": "error",
},
},
];react/jsx-max-depth
react plugin · style
{
"plugins": [
"react"
],
"rules": {
"react/jsx-max-depth": "error"
}
}Biome does not have this rule.
Ensure destructuring and symmetric naming of useState hook value and setter variables
Require all forwardRef components include a ref parameter