Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPrevent callback in try block #423
Comments
dcousens
added
the
enhancement
label
Feb 17, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Agree conceptually. The first step is to propose this in eslint. I'd prefer to not maintain our own rules, since that's a ton of work. |
feross
changed the title
Possible idea for rule
Prevent callback in try block
Feb 19, 2016
feross
added
the
blocked
label
Feb 19, 2016
This comment has been minimized.
This comment has been minimized.
|
I'm going to close this issue due to lack of progress. This rule isn't really something that I, or any of the other Then, send a PR to add the rule to |
LinusU commentedFeb 17, 2016
I misstake that I've seen quite a few people doing is calling a callback in a
tryblock, not thinking about the fact that any error occurring in the callback will now be catched as well.Example bad code:
What the authors intent really was:
I understand that this might be a bit hard to implement, but I still think that it at the very least is worth discussing.
Would it be unreasonable to assume that every variable named
cbis a callback? It seems to be the accepted practice to name it as such, in the same way that we have rules that assumes that variables namederrare errors, and needs to be handled.What do you think?