# no-accumulating-spread

Rule `oxc/no-accumulating-spread`. Prevents using object or array spreads on accumulators in `Array.prototype.reduce()` and in loops.

- Source: oxc
- Technologies: JavaScript
- Kind: performance
- Needs type information: no
- Autofix: no
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +151.7% last quarter
- Rank: #1532 by reach, #36 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Oxlint | `oxc/no-accumulating-spread` | no | no | plugin `oxc`, category perf | [docs](https://oxc.rs/docs/guide/usage/linter/rules/oxc/no-accumulating-spread.html) |

## Code examples

### Incorrect: the rule reports this

```js
arr.reduce((acc, x) => ({ ...acc, [x]: fn(x) }), {})
Object.keys(obj).reduce((acc, el) => ({ ...acc, [el]: fn(el) }), {})

let foo = []; for (let i = 0; i < 10; i++) { foo = [...foo, i]; }
```

### Correct: the rule accepts this

```js
function fn (x) {
  // ...
}

arr.reduce((acc, x) => acc.push(fn(x)), [])
Object.keys(obj).reduce((acc, el) => {
  acc[el] = fn(el)
}, {})
// spreading non-accumulators should be avoided if possible, but is not
// banned by this rule
Object.keys(obj).reduce((acc, el) => {
  acc[el] = { ...obj[el] }
  return acc
}, {})

let foo = []; for (let i = 0; i < 10; i++) { foo.push(i); }
```

Examples from the Oxlint documentation.

## Enable it

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "oxc/no-accumulating-spread": "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/misrefactored-assign-op](https://lintradar.dev/rules/oxc/misrefactored-assign-op.md): Https://rust-lang.github.io/rust-clippy/master/#/misrefactored_assign_op
- [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/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-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/no-accumulating-spread. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
