promise/no-nesting
Configuration
rslint.config.ts
Rule Details
Disallow nesting .then() or .catch() statements inside promise callbacks when the
inner call does not depend on variables introduced by the enclosing callback.
Deeply nested promise chains are harder to read and can usually be rewritten as a flat
chain. This rule flags the inner .then() / .catch() when its arguments do not
reference any binding (parameter or local variable) that belongs to the immediately
enclosing promise callback, because in that case the nesting is unnecessary.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Original Documentation
https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-nesting.md