# jsx-sort-props

Rule `react/jsx-sort-props`. Enforce props alphabetical sorting

- Source: react
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1880 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/jsx-sort-props` | no | safe | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-sort-props.md) |

## Code examples

### Incorrect: the rule reports this

```jsx
<Hello lastName="Smith" firstName="John" />
```

### Correct: the rule accepts this

```jsx
<Hello firstName="John" lastName="Smith" />;
<Hello tel={5555555} {...this.props} firstName="John" lastName="Smith" />;
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import react from "eslint-plugin-react";

export default [
  {
    plugins: { react },
    rules: {
      "react/jsx-sort-props": "error",
    },
  },
];
```

## Related rules

- [react/jsx-newline](https://lintradar.dev/rules/react/jsx-newline.md): Require or prevent a new line after jsx elements and expressions.
- [react/no-adjacent-inline-elements](https://lintradar.dev/rules/react/no-adjacent-inline-elements.md): Disallow adjacent inline elements not separated by whitespace.
- [react/jsx-child-element-spacing](https://lintradar.dev/rules/react/jsx-child-element-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- [react/prefer-read-only-props](https://lintradar.dev/rules/react/prefer-read-only-props.md): Enforce that props are read-only
- [react/boolean-prop-naming](https://lintradar.dev/rules/react/boolean-prop-naming.md): Enforces consistent naming for boolean props
- [react/require-optimization](https://lintradar.dev/rules/react/require-optimization.md): Enforce React components to have a shouldComponentUpdate method

---

Web page: https://lintradar.dev/rules/react/jsx-sort-props. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
