# no-useless-promise-resolve-reject

Rule `unicorn/no-useless-promise-resolve-reject`. Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks

- Source: unicorn
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 12M weekly downloads of presets that enable it
- Trend: +40.1% last quarter
- Rank: #787 by reach, #983 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-useless-promise-resolve-reject` | no | safe | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-useless-promise-resolve-reject.md) |
| Oxlint | `unicorn/no-useless-promise-resolve-reject` | no | safe | plugin `unicorn`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-promise-resolve-reject.html) |

## Code examples

### Incorrect: the rule reports this

```js
const main = async foo => {
  if (foo > 4) {
    return Promise.reject(new Error('🤪'));
  }

  return Promise.resolve(result);
};
```

```js
async function * generator() {
  yield Promise.resolve(result);
  yield Promise.reject(error);
}
```

```js
promise
  .then(x => {
    if (x % 2 == 0) {
      return Promise.resolve(x / 2);
    }

    return Promise.reject(new Error('odd number'));
  })
  .catch(error => Promise.reject(new FancyError(error)));
```

### Correct: the rule accepts this

```js
const main = async foo => {
  if (foo > 4) {
    throw new Error('🤪');
  }

  return result;
};
```

```js
async function * generator() {
  yield result;
  throw error;
}
```

```js
promise
  .then(x => {
    if (x % 2 == 0) {
      return x / 2;
    }

    throw new Error('odd number');
  })
  .catch(error => {
    throw new FancyError(error);
  });
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/no-useless-promise-resolve-reject": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicorn/no-useless-promise-resolve-reject": "error"
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |
| [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% |

## Related rules

- [unicorn/no-useless-error-capture-stack-trace](https://lintradar.dev/rules/unicorn/no-useless-error-capture-stack-trace.md): Disallow unnecessary `Error.captureStackTrace(…)`.
- [unicorn/prefer-add-event-listener](https://lintradar.dev/rules/unicorn/prefer-add-event-listener.md): Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
- [unicorn/no-useless-collection-argument](https://lintradar.dev/rules/unicorn/no-useless-collection-argument.md): Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
- [unicorn/prefer-array-find](https://lintradar.dev/rules/unicorn/prefer-array-find.md): Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
- [unicorn/no-unreadable-array-destructuring](https://lintradar.dev/rules/unicorn/no-unreadable-array-destructuring.md): Disallow unreadable array destructuring.
- [unicorn/prefer-array-flat](https://lintradar.dev/rules/unicorn/prefer-array-flat.md): Prefer `Array#flat()` over legacy techniques to flatten arrays.

---

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