react/jsx-props-no-spreading
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-props-no-spreading": "error",
},
},
];<App {...props} />
<MyCustomComponent {...props} some_other_prop={some_other_prop} />
<img {...props} />const {src, alt} = props;
const {one_prop, two_prop} = otherProps;
<MyCustomComponent one_prop={one_prop} two_prop={two_prop} />
<img src={src} alt={alt} />Examples from the ESLint documentation.
react/jsx-props-no-spreading
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-props-no-spreading": "error",
},
},
];react/jsx-props-no-spreading
react plugin · style
{
"plugins": [
"react"
],
"rules": {
"react/jsx-props-no-spreading": "error"
}
}Biome does not have this rule.
Disallow usage of setState in componentWillUpdate
Enforce boolean attributes notation in JSX
Enforce class component state initialization style
Enforce a specific function type for function components
Enforce all defaultProps have a corresponding non-required PropType
Enforces where React component static properties should be positioned.