Skip to content

prefer-await-in-async-return

Prefer explicit await when an async function directly returns one typed Promise .then transform.

Why

Mixing a directly returned Promise callback into otherwise async control flow makes sequencing and failures harder to read.

Fix

Consider awaiting the Promise and returning the transformed value with ordinary async statements. Preserve catch boundaries, callback behavior, and observable scheduling when rewriting manually.

Examples

Before — flagged Do not directly return a Promise callback chain from async code
src/load.ts
async function load() {
return Promise.resolve(1).then((value) => value + 1);
}
After — preferred Use explicit async control flow
src/load.ts
async function load() {
const value = await Promise.resolve(1);
return value + 1;
}