eslint-plugin-promise
eslint-plugin-promise copied to clipboard
no-callback-in-promise use cases
It has been requested that we support these use cases in the no-callback-in-promise
rule
// TODO: support safe callbacks
// 'whatever.then((err) => { process.nextTick(() => cb()) })',
// 'whatever.then((err) => { setImmediate(() => cb())) })',
// 'whatever.then((err) => setImmediate(() => cb()))',
// 'whatever.then((err) => process.nextTick(() => cb()))',
// 'whatever.then((err) => process.nextTick(cb))',
// 'whatever.then((err) => setImmediate(cb))',
It has been requested that we support these use cases in the
no-callback-in-promise
rule// TODO: support safe callbacks // 'whatever.then((err) => { process.nextTick(() => cb()) })', // 'whatever.then((err) => { setImmediate(() => cb())) })', // 'whatever.then((err) => setImmediate(() => cb()))', // 'whatever.then((err) => process.nextTick(() => cb()))', // 'whatever.then((err) => process.nextTick(cb))', // 'whatever.then((err) => setImmediate(cb))',
This is exactly what the documentation recommends. Is there a reason why it isn't supported here?
https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-callback-in-promise.md