# no-await-in-loop

Rule `eslint/no-await-in-loop`. Disallow `await` inside of loops

- Source: eslint
- Technologies: JavaScript
- Kind: performance
- Needs type information: no
- Autofix: no
- Reach: 12.6M weekly downloads of presets that enable it
- Trend: +13.3% last quarter
- Rank: #741 by reach, #1428 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-await-in-loop` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-await-in-loop) |
| Oxlint | `no-await-in-loop` | no | no | plugin `eslint`, category perf | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-await-in-loop.html) |
| Biome | `performance/noAwaitInLoops` | no | no | group performance, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/no-await-in-loops/) |

## Code examples

### Incorrect: the rule reports this

```js
async function foo(things) {
  const results = [];
  for (const thing of things) {
    // Bad: each loop iteration is delayed until the entire asynchronous operation completes
    results.push(await doAsyncWork(thing));
  }
  return results;
}

async function bar(things) {
  for (const thing of things) {
    await using resource = getAsyncResource(thing);
  }
}
```

### Correct: the rule accepts this

```js
async function foo(things) {
  const promises = [];
  for (const thing of things) {
    // Good: all asynchronous operations are immediately started.
    promises.push(doAsyncWork(thing));
  }
  // Now that all the asynchronous operations are running, here we wait until they all complete.
  const results = await Promise.all(promises);
  return results;
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "no-await-in-loop": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-await-in-loop": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "performance": {
        "noAwaitInLoops": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [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% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/arrow-body-style](https://lintradar.dev/rules/eslint/arrow-body-style.md): Require braces around arrow function bodies
- [eslint/no-lonely-if](https://lintradar.dev/rules/eslint/no-lonely-if.md): Disallow `if` statements as the only statement in `else` blocks
- [eslint/no-promise-executor-return](https://lintradar.dev/rules/eslint/no-promise-executor-return.md): Disallow returning values from Promise executor functions
- [eslint/no-multi-assign](https://lintradar.dev/rules/eslint/no-multi-assign.md): Disallow use of chained assignment expressions
- [eslint/prefer-object-spread](https://lintradar.dev/rules/eslint/prefer-object-spread.md): Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
- [eslint/operator-assignment](https://lintradar.dev/rules/eslint/operator-assignment.md): Require or disallow assignment operator shorthand where possible

---

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