Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 531 Bytes

no-nesting.md

File metadata and controls

23 lines (14 loc) · 531 Bytes

Disallow nested then() or catch() statements (promise/no-nesting)

⚠️ This rule warns in the ✅ recommended config.

Valid

myPromise.then(doSomething).then(doSomethingElse).catch(errors)

Invalid

myPromise.then((val) => doSomething(val).then(doSomethingElse))

myPromise.then((val) => doSomething(val).catch(errors))

myPromise.catch((err) => doSomething(err).then(doSomethingElse))

myPromise.catch((err) => doSomething(err).catch(errors))