# prefer-await-to-callbacks

Rule `promise/prefer-await-to-callbacks`. Prefer `async`/`await` to the callback pattern.

- Source: promise
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +151.7% last quarter
- Rank: #1528 by reach, #32 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
cb()
callback()
doSomething(arg, (err) => {})
function doSomethingElse(cb) {}
```

### Correct: the rule accepts this

```js
await doSomething(arg)
async function doSomethingElse() {}
yield yieldValue(err => {})
eventEmitter.on('error', err => {})
```

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-await-to-callbacks": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "promise"
  ],
  "rules": {
    "promise/prefer-await-to-callbacks": "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% |

## Related rules

- [promise/spec-only](https://lintradar.dev/rules/promise/spec-only.md): Disallow use of non-standard Promise static methods.
- [promise/prefer-catch](https://lintradar.dev/rules/promise/prefer-catch.md): Prefer `catch` to `then(a, b)`/`then(null, b)` for handling errors.
- [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-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-await-to-callbacks. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
