# prefer-catch

Rule `promise/prefer-catch`. Prefer `catch` to `then(a, b)`/`then(null, b)` for handling errors.

- Source: promise
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.2M weekly downloads of presets that enable it
- Trend: +137.0% last quarter
- Rank: #1497 by reach, #90 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `promise/prefer-catch` | no | safe | package `eslint-plugin-promise` | [docs](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-catch.md) |
| Oxlint | `promise/prefer-catch` | no | suggestion | plugin `promise`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/promise/prefer-catch.html) |

## Code examples

### Incorrect: the rule reports this

```js
prom.then(fn1).then(fn2)
prom.catch(handleErr).then(handle)
```

```js
hey.then(fn1, fn2)
hey.then(null, fn2)
```

Examples from the ESLint documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "promise"
  ],
  "rules": {
    "promise/prefer-catch": "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% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [promise/no-multiple-resolved](https://lintradar.dev/rules/promise/no-multiple-resolved.md): Disallow creating new promises with paths that resolve multiple times.
- [promise/avoid-new](https://lintradar.dev/rules/promise/avoid-new.md): Disallow creating `new` promises outside of utility libs (use [util.promisify][] instead).
- [promise/prefer-await-to-callbacks](https://lintradar.dev/rules/promise/prefer-await-to-callbacks.md): Prefer `async`/`await` to the callback pattern.
- [promise/spec-only](https://lintradar.dev/rules/promise/spec-only.md): Disallow use of non-standard Promise static methods.
- [promise/prefer-await-to-then](https://lintradar.dev/rules/promise/prefer-await-to-then.md): Prefer `await` to `then()`/`catch()`/`finally()` for reading Promise values.
- [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/prefer-catch. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
