eslint-plugin-promise icon indicating copy to clipboard operation
eslint-plugin-promise copied to clipboard

no-callback-in-promise use cases

Open xjamundx opened this issue 3 years ago • 2 comments

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))',

xjamundx avatar Oct 21 '21 05:10 xjamundx

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))',

Sandesh333333 avatar Jan 21 '22 06:01 Sandesh333333

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

jack828 avatar Jun 08 '22 17:06 jack828