no-return-wrap
Configuration
rslint.config.ts
Disallow wrapping values in Promise.resolve or Promise.reject when not needed.
Rule Details
Inside a .then(), .catch(), or .finally() callback, returning a raw value
already resolves the promise chain with that value, and throwing already rejects
it. This rule reports callbacks that return Promise.resolve(...) or
Promise.reject(...) instead of using the direct value or throw.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
allowReject
Pass { "allowReject": true } to allow returning Promise.reject(...) from a
promise callback. Promise.resolve(...) remains disallowed.
Differences from ESLint
None known.