Pattern: Use of return
in finally()
Issue: -
Disallow return statements inside a callback passed to finally()
, since nothing would consume what's returned.
Example of correct code:
myPromise.finally(function(val) {
console.log('value:', val)
})
Example of incorrect code:
myPromise.finally(function(val) {
return val
})