eslint-plugin-promise
eslint-plugin-promise copied to clipboard
no-callback-in-async-function rule?
Putting callback code inside of async functions like this can lead to a lot of trouble:
async function bigProbs() {
doSomething(function(err) {
if (err) throw err; // won't be caught by the parent
// ...
})
}
Would something like this address the issue:
async function bigProbs() {
try
{
doSomething(function(err) {
if (err) throw err; // won't be caught by the parent
// ...
})
}
catch(e)
{
throw(e);
}
}
If so, can you not warn when the try catch is throwing to the parent?