Skip to content
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

fix(no-unsafe-finally): deal with if-statements or functions in finally blocks, etc. #641

Merged
merged 8 commits into from
Mar 30, 2021

Conversation

magurotuna
Copy link
Member

Part of #330, #431

  • rewrite the implementation with dprint-swc-ecma-ast-view
  • add hint message
  • refine the implementation so it can properly work for a) if-statements or functions in finally blocks, b) labeled statements
  • add/port more tests referring to ESLint


pub struct NoUnsafeFinally;

const CODE: &str = "no-unsafe-finally";
const HINT: &str = "Use of the control flow statements (`return`, `throw`, `break` and `continue`) in a `finally` block will most likely lead to undesired behavior. It's recommended to take a second look.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove It's recommended to take a second look.. Also it seems that this line exceeds 120 chars, could it be split into multiline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fixed it!

@bartlomieju bartlomieju merged commit 64afb11 into denoland:main Mar 30, 2021
@magurotuna magurotuna deleted the macro/no-unsafe-finally branch March 31, 2021 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants