I think in most cases need a promise, using Promise.withResolvers()
should be more readable than new Promise()
, because new Promise
needs a new function scope.
I opened this issue instead of a rule proposal, since I'm not sure about it and want to discuss it first.
Welcome to post cases where new Promise()
should be preferred.
The only case in my mind is the arrow function body.
const foo = () => new Promise(resolve => {
resolve()
});
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too