no-promise-executor-return
Added in v0.8.1Configuration
rslint.config.ts
Rule Details
The new Promise constructor accepts a single argument, called an executor. The executor's return value is ignored: it cannot be read and it does not affect the promise in any way, so returning a value from it is usually a mistake.
This rule disallows returning values from Promise executor functions. Only return without a value is allowed, as it's a control flow statement.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule takes one option, an object, with the following properties:
allowVoid: If set totrue(falseby default), this rule will allow returning void values.
allowVoid
Examples of correct code for this rule with the { "allowVoid": true } option: