Minimal reproduction:
Promise.resolve().finally(async () => {
return;
});
Error:
**
Promise returned in function argument where a void return was expected. (sonarjs/no-misused-promises)**
Returning Promise in function given as argument to finally method is actually valid and works as expected under ES specification, as result of call is awaited.
ECMAScript® 2026 Language Specification
i. Let result be ? Call(onFinally, undefined).
ii. Let p be ? PromiseResolve(C, result).
It’s pretty likely that Promise.prototype.finally should be special-cased to allow this.