react/jsx-sort-props
eslint-plugin-react
Safe autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-sort-props": "error",
},
},
];<Hello lastName="Smith" firstName="John" /><Hello firstName="John" lastName="Smith" />;
<Hello tel={5555555} {...this.props} firstName="John" lastName="Smith" />;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-sort-props
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-sort-props": "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 or disallow spaces inside of curly braces in JSX attributes and expressions
Enforce React components to have a shouldComponentUpdate method