# no-array-reduce

Rule `unicorn/no-array-reduce`. Disallow `Array#reduce()` and `Array#reduceRight()`.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 12M weekly downloads of presets that enable it
- Trend: +40.1% last quarter
- Rank: #819 by reach, #1015 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-array-reduce` | no | safe | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-array-reduce.md) |
| Oxlint | `unicorn/no-array-reduce` | no | no | plugin `unicorn`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-reduce.html) |
| Biome | `nursery/noArrayReduce` | no | no | group nursery, since 2.6.10 | [docs](https://biomejs.dev/linter/rules/no-array-reduce/) |

## Code examples

### Incorrect: the rule reports this

```js
array.reduce(reducer);
```

```js
array.reduce(reducer, initialValue);
```

```js
[].reduce.apply(array, [reducer, initialValue]);
```

### Correct: the rule accepts this

```js
// eslint-disable-next-line unicorn/no-array-reduce
array.reduce(reducer);
```

```js
let result = initialValue;

for (const [index, element] of array.entries()) {
  result = reducer(result, element, index, array);
}
```

```js
array.reduce((total, value) => total + value);
```

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-array-reduce": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicorn/no-array-reduce": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noArrayReduce": "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% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/catch-error-name](https://lintradar.dev/rules/unicorn/catch-error-name.md): Enforce a specific parameter name in catch clauses.
- [unicorn/no-immediate-mutation](https://lintradar.dev/rules/unicorn/no-immediate-mutation.md): Disallow immediate mutation after assignment and initialization immediately after declaration.
- [unicorn/text-encoding-identifier-case](https://lintradar.dev/rules/unicorn/text-encoding-identifier-case.md): Enforce consistent case for text encoding identifiers.
- [unicorn/consistent-assert](https://lintradar.dev/rules/unicorn/consistent-assert.md): Enforce consistent assertion style with `node:assert`.
- [unicorn/require-module-specifiers](https://lintradar.dev/rules/unicorn/require-module-specifiers.md): Require non-empty specifier list in import and export statements.
- [unicorn/consistent-template-literal-escape](https://lintradar.dev/rules/unicorn/consistent-template-literal-escape.md): Enforce consistent style for escaping `${` in template literals.

---

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