You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Promisification utilities like Bluebird.fromCallback are useful to interface with Node-style APIs. Unfortunately, no-callback-in-promise isn't smart enough to realize that these are legitimate uses for calling a callback inside a promise.
Workaround is to rename the name of the callback. But often times you want to shadow an outer callback and so that's not always feasible.
Steps to Reproduce
returnPromise.resolve().then(()=>{returnBluebird.fromCallback(callback=>{callback();// this will fail});});
Expected behavior: does not fail no-callback-in-promise
Actual behavior: fails no-callback-in-promise
Versions
Node version: 8
ESLint version: 4.19.1
eslint-plugin-promise version: 4.2.1
Additional Information
I understand if this is hard to detect and not worth doing. But I think the heuristic to use is if the callback originates from inside the promise, then it's safe to call.
The text was updated successfully, but these errors were encountered:
Description
Promisification utilities like
Bluebird.fromCallback
are useful to interface with Node-style APIs. Unfortunately,no-callback-in-promise
isn't smart enough to realize that these are legitimate uses for calling a callback inside a promise.Workaround is to rename the name of the callback. But often times you want to shadow an outer callback and so that's not always feasible.
Steps to Reproduce
Expected behavior: does not fail
no-callback-in-promise
Actual behavior: fails
no-callback-in-promise
Versions
Additional Information
I understand if this is hard to detect and not worth doing. But I think the heuristic to use is if the callback originates from inside the promise, then it's safe to call.
The text was updated successfully, but these errors were encountered: