# prefer-promise-reject-errors

Rule `eslint/prefer-promise-reject-errors`. Require using Error objects as Promise rejection reasons

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 16.9M weekly downloads of presets that enable it
- Trend: +15.6% last quarter
- Rank: #648 by reach, #1401 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `prefer-promise-reject-errors` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/prefer-promise-reject-errors) |
| Oxlint | `prefer-promise-reject-errors` | no | no | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-promise-reject-errors.html) |
| Biome | `nursery/usePromiseRejectErrors` | no | no | group nursery, since 2.5.15 | [docs](https://biomejs.dev/linter/rules/use-promise-reject-errors/) |

## Code examples

### Incorrect: the rule reports this

```js
Promise.reject("something bad happened");

Promise.reject(5);

Promise.reject();

new Promise(function(resolve, reject) {
  reject("something bad happened");
});

new Promise(function(resolve, reject) {
  reject();
});
```

### Correct: the rule accepts this

```js
Promise.reject(new Error("something bad happened"));

Promise.reject(new TypeError("something bad happened"));

new Promise(function(resolve, reject) {
  reject(new Error("something bad happened"));
});

const foo = getUnknownValue();
Promise.reject(foo);
```

```js
Promise.reject();

new Promise(function(resolve, reject) {
  reject();
});
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "prefer-promise-reject-errors": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "prefer-promise-reject-errors": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "usePromiseRejectErrors": "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% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [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% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [typescript/prefer-promise-reject-errors](https://lintradar.dev/rules/typescript/prefer-promise-reject-errors.md): Require using Error objects as Promise rejection reasons
- [eslint/symbol-description](https://lintradar.dev/rules/eslint/symbol-description.md): Require symbol descriptions
- [eslint/no-unreachable-loop](https://lintradar.dev/rules/eslint/no-unreachable-loop.md): Disallow loops with a body that allows only one iteration
- [eslint/no-useless-return](https://lintradar.dev/rules/eslint/no-useless-return.md): Disallow redundant return statements
- [eslint/object-shorthand](https://lintradar.dev/rules/eslint/object-shorthand.md): Require or disallow method and property shorthand syntax for object literals
- [eslint/no-restricted-globals](https://lintradar.dev/rules/eslint/no-restricted-globals.md): Disallow specified global variables

---

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