> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# async-promise-executor

> The built-in Promise constructor is given an async executor.

## What it flags

`new Promise(async (resolve) => ...)` starts an async executor. The constructor discards the executor's returned promise. The caller's `.catch()` observes the outer promise. If the executor rejects without forwarding the error through `reject`, the outer promise can remain pending and the caller's handler never runs.

The rule skips an executor whose whole body is one `try` whose `catch` calls the executor's `reject` parameter on every path before anything else, and whose `catch` and `finally` blocks do not await.

## How to review or fix

Return the async operation directly when its promise represents the intended result. For a callback-based API that still needs an executor, keep the executor synchronous and explicitly settle the outer promise on both success and failure.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.