no-async-promise-executor
Configuration
rslint.config.ts
Rule Details
Disallows passing an async function as the executor to new Promise(). Using an async executor is usually a mistake because if the async executor throws an error, the error will be lost and will not cause the newly-constructed Promise to reject. Additionally, if a Promise executor uses await, this is usually a sign that it is not actually necessary to use the new Promise constructor.
Examples of incorrect code for this rule:
Examples of correct code for this rule: