-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule to prevent no-op promise handlers #12
Labels
Comments
Agreed this is a good idea |
Sorry to finally get back to these suggestions. I agree with this one. I imagine it's similar to how people sometimes do things like this: doThing(function(err, data) {
if (err) return callback(err)
callback(null, data)
}) One decent reason for it is because it's a place to add some logging, but you know without the logs we should just remove it. I'm down. I'll see if I can work on this today/tomorow. |
Taking a look at implementing this rule this week. |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: eslint/eslint#5761
Rule to throw when the identify function is used as the success handler of a Promise or the "throw function" is used as the failure handler of a Promise.
It helps users to understand how promise values propagate.
Usually when people write
.catch(err => { throw err; })
they intend to throw the error into the next tick to make sure it's reported, not to add a no-op to the end of their promise chain.The text was updated successfully, but these errors were encountered: