# no-nesting

Rule `promise/no-nesting`. Disallow nested `then()` or `catch()` statements.

- Source: promise
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +30.4% last quarter
- Rank: #1110 by reach, #1128 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `promise/no-nesting` | yes | no | package `eslint-plugin-promise` | [docs](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-nesting.md) |
| Oxlint | `promise/no-nesting` | no | no | plugin `promise`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/promise/no-nesting.html) |
| Biome | `suspicious/noNestedPromises` | no | no | group suspicious, since 2.3.15 | [docs](https://biomejs.dev/linter/rules/no-nested-promises/) |

## Code examples

### Incorrect: the rule reports this

```js
myPromise.then((val) => doSomething(val).then(doSomethingElse))

myPromise.then((val) => doSomething(val).catch(errors))

myPromise.catch((err) => doSomething(err).then(doSomethingElse))

myPromise.catch((err) => doSomething(err).catch(errors))
```

### Correct: the rule accepts this

```js
myPromise.then(doSomething).then(doSomethingElse).catch(errors)
```

Examples from the ESLint documentation.

## Enable it

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

```js
import promise from "eslint-plugin-promise";

export default [
  {
    plugins: { promise },
    rules: {
      "promise/no-nesting": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "promise"
  ],
  "rules": {
    "promise/no-nesting": "error"
  }
}
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Promise recommended](https://lintradar.dev/presets/promise-recommended.md) | ESLint | `eslint-plugin-promise` | 10 | 7.8M | +15.7% |
| [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% |

## Related rules

- [promise/always-return](https://lintradar.dev/rules/promise/always-return.md): Require returning inside each `then()` to create readable and reusable Promise chains.
- [promise/catch-or-return](https://lintradar.dev/rules/promise/catch-or-return.md): Enforce the use of `catch()` on un-returned promises.
- [promise/no-callback-in-promise](https://lintradar.dev/rules/promise/no-callback-in-promise.md): Disallow calling `cb()` inside of a `then()` (use [util.callbackify][] instead).
- [promise/no-new-statics](https://lintradar.dev/rules/promise/no-new-statics.md): Disallow calling `new` on a Promise static method.
- [promise/no-promise-in-callback](https://lintradar.dev/rules/promise/no-promise-in-callback.md): Disallow using promises inside of callbacks.
- [promise/valid-params](https://lintradar.dev/rules/promise/valid-params.md): Enforces the proper number of arguments are passed to Promise functions.

---

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