This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Rule request: forbid return in finally #1097
Comments
sounds reasonable. is there any analogous rule for ESLint? if not, that's cool too |
not yet. eslint/eslint#5808 |
lowkay
added a commit
to lowkay/tslint
that referenced
this issue
Jun 26, 2016
jkillian
pushed a commit
that referenced
this issue
Jul 21, 2016
…1349) * Implement rule to forbid return statements in finally blocks #1097 * explore the try statement fully to pick up violations in nested scopes * switch to a scope aware rule walker to reduce number of passes over the AST * Add support for other control flow statements in finally blocks (break, continue, throws) * improve the rationale description for the no unsafe finally rule * rename rule to no-unsafe-finally to be inline with eslint * add new rule to latest config * pull out helper functions from the walker class. * fix tslint violations (which didn't occur locally)
soniro
pushed a commit
to soniro/tslint
that referenced
this issue
Aug 31, 2016
…#1097 (palantir#1349) * Implement rule to forbid return statements in finally blocks palantir#1097 * explore the try statement fully to pick up violations in nested scopes * switch to a scope aware rule walker to reduce number of passes over the AST * Add support for other control flow statements in finally blocks (break, continue, throws) * improve the rationale description for the no unsafe finally rule * rename rule to no-unsafe-finally to be inline with eslint * add new rule to latest config * pull out helper functions from the walker class. * fix tslint violations (which didn't occur locally)
Should be fixed by #1349. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Adding a
return
statement in afinally
block is a very confusing thing. Thrown errors get ignored,return
statements intry
blocks get ignored, and your mind explodes.I'd love to have a rule to forbid this. Especially now that we're having
async
/await
.examples:
The text was updated successfully, but these errors were encountered: