# no-shorthand-property-overrides

Rule `unicorn/no-shorthand-property-overrides`. Disallow shorthand properties that override related longhand properties.

- Source: unicorn
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +28.3% last quarter
- Rank: #946 by reach, #1201 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-shorthand-property-overrides` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-shorthand-property-overrides.md) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div style={{paddingLeft: 10, padding: 20}} />;
```

### Correct: the rule accepts this

```jsx
<div style={{padding: 20, paddingLeft: 10}} />;
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/no-shorthand-property-overrides": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/no-redundant-comparison](https://lintradar.dev/rules/unicorn/no-redundant-comparison.md): Disallow comparisons made redundant by an equality check in the same logical AND.
- [unicorn/no-transition-all](https://lintradar.dev/rules/unicorn/no-transition-all.md): Disallow `all` as a transition property.
- [unicorn/no-prevent-default-in-passive-listener](https://lintradar.dev/rules/unicorn/no-prevent-default-in-passive-listener.md): Disallow ineffective `preventDefault()` calls in passive event listeners.
- [unicorn/no-unnecessary-fetch-options](https://lintradar.dev/rules/unicorn/no-unnecessary-fetch-options.md): Disallow unnecessary options in `fetch()` and `new Request()`.
- [unicorn/no-nonstandard-builtin-properties](https://lintradar.dev/rules/unicorn/no-nonstandard-builtin-properties.md): Disallow non-standard properties on built-in objects.
- [unicorn/no-unnecessary-global-this](https://lintradar.dev/rules/unicorn/no-unnecessary-global-this.md): Disallow unnecessary `globalThis` references.

---

Web page: https://lintradar.dev/rules/unicorn/no-shorthand-property-overrides. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
