# array-callback-return

Rule `eslint/array-callback-return`. Enforce `return` statements in callbacks of array methods

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 49.4M weekly downloads of presets that enable it
- Trend: +52.9% last quarter
- Rank: #254 by reach, #752 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `array-callback-return` | no | suggestion | package `eslint` | [docs](https://eslint.org/docs/latest/rules/array-callback-return) |
| Oxlint | `array-callback-return` | no | no | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/array-callback-return.html) |
| Biome | `suspicious/useIterableCallbackReturn` | yes | no | group suspicious, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-iterable-callback-return/) |

## Code examples

### Incorrect: the rule reports this

```js
const indexMap = myArray.reduce(function(memo, item, index) {
    memo[item] = index;
}, {});

const foo = Array.from(nodes, function(node) {
    if (node.tagName === "DIV") {
        return true;
    }
});

const bar = foo.filter(function(x) {
    if (x) {
        return true;
    } else {
        return;
    }
});
```

### Correct: the rule accepts this

```js
const indexMap = myArray.reduce(function(memo, item, index) {
    memo[item] = index;
    return memo;
}, {});

const foo = Array.from(nodes, function(node) {
    if (node.tagName === "DIV") {
        return true;
    }
    return false;
});

const bar = foo.map(node => node.getAttribute("id"));
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "array-callback-return": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "array-callback-return": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "useIterableCallbackReturn": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [eslint/no-lone-blocks](https://lintradar.dev/rules/eslint/no-lone-blocks.md): Disallow unnecessary nested blocks
- [eslint/no-template-curly-in-string](https://lintradar.dev/rules/eslint/no-template-curly-in-string.md): Disallow template literal placeholder syntax in regular strings
- [eslint/no-labels](https://lintradar.dev/rules/eslint/no-labels.md): Disallow labeled statements
- [eslint/no-implied-eval](https://lintradar.dev/rules/eslint/no-implied-eval.md): Disallow the use of `eval()`-like methods
- [eslint/no-octal-escape](https://lintradar.dev/rules/eslint/no-octal-escape.md): Disallow octal escape sequences in string literals
- [eslint/no-sequences](https://lintradar.dev/rules/eslint/no-sequences.md): Disallow comma operators

---

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