# misrefactored-assign-op

Rule `oxc/misrefactored-assign-op`. Https://rust-lang.github.io/rust-clippy/master/#/misrefactored_assign_op

- Source: oxc
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +151.7% last quarter
- Rank: #1531 by reach, #35 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Oxlint | `oxc/misrefactored-assign-op` | no | safe | plugin `oxc`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/oxc/misrefactored-assign-op.html) |

## Code examples

### Incorrect: the rule reports this

```js
a += a + b;
a -= a - b;
```

### Correct: the rule accepts this

```js
a += b;
a -= b;
```

Examples from the Oxlint documentation.

## Enable it

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "oxc/misrefactored-assign-op": "error"
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |

## Related rules

- [oxc/approx-constant](https://lintradar.dev/rules/oxc/approx-constant.md): Disallows the use of approximate constants, instead preferring the use of the constants in the `Math` object.
- [oxc/no-accumulating-spread](https://lintradar.dev/rules/oxc/no-accumulating-spread.md): Prevents using object or array spreads on accumulators in `Array.prototype.reduce()` and in loops.
- [oxc/no-async-endpoint-handlers](https://lintradar.dev/rules/oxc/no-async-endpoint-handlers.md): Disallows the use of `async` functions as Express endpoint handlers.
- [oxc/no-barrel-file](https://lintradar.dev/rules/oxc/no-barrel-file.md): Disallow the use of barrel files where the file contains `export *` statements, and the total number of modules exceeds a threshold.
- [oxc/no-const-enum](https://lintradar.dev/rules/oxc/no-const-enum.md): Disallow TypeScript `const enum`
- [oxc/no-this-in-exported-function](https://lintradar.dev/rules/oxc/no-this-in-exported-function.md): Disallows the use of `this` in exported functions.

---

Web page: https://lintradar.dev/rules/oxc/misrefactored-assign-op. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
