no-promise-in-callback
Configuration
Disallow using promises inside callbacks.
Rule Details
Promises and callbacks are different ways to handle asynchronous code. Mixing the styles inside the same callback can make error handling unclear: callback errors are usually passed through the callback argument, while promise errors must be handled through the promise chain.
This rule reports promise-like calls inside callback-like functions whose first
parameter is named err or error.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Promise callbacks passed to .then() or .catch() are not treated as callback
containers for this rule.
Options
exemptDeclarations
Pass { "exemptDeclarations": true } to exempt function declarations. Defaults
to false.
With this option enabled, this code is valid:
Function expressions and arrow functions are still checked when this option is enabled.
Differences from ESLint
None known.