Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 493 Bytes

no-return-in-finally.md

File metadata and controls

25 lines (18 loc) · 493 Bytes

Disallow return statements in finally() (promise/no-return-in-finally)

⚠️ This rule warns in the following configs: ✅ flat/recommended, ✅ recommended.

Disallow return statements inside a callback passed to finally(), since nothing would consume what's returned.

Valid

myPromise.finally(function (val) {
  console.log('value:', val)
})

Invalid

myPromise.finally(function (val) {
  return val
})