question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'no-unsafe-finally' rule gives errors on safe code

See original GitHub issue

What version of ESLint are you using? eslint@e606523

What parser (default, Babel-ESLint, etc.) are you using? default

What did you do? Please include the actual source code causing the issue. Rule no-unsafe-finally gives an error on the following code:

try {} finally {
  while(true) {
    break;
  }
}

What did you expect to happen? No errors.

What actually happened? Please include the actual, raw output from ESLint. Unsafe usage of BreakStatement no-unsafe-finally

More generally, break and continue statements need to check that the statement being broken or continued is not interior to the finally block. This involves checking labels, if present.

ping @onurtemizkan, @platinumazure.

See #5808, #5932.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bakkotcommented, Apr 26, 2016

@louy, that one’s handled correctly.

Easiest way to test it yourself is to clone master, npm install, then ./bin/eslint.js --no-eslintrc --rule 'no-unsafe-finally: 1' test.js.

0reactions
mysticateacommented, Apr 27, 2016

Oh, good catch!

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-config-nicestyle - npm package - Snyk
This config is midly strict and you can overwrite or add rule if you want. ... no-unsafe-finally, error ... Is eslint-config-nicestyle safe to...
Read more >
Code Issues - Embold Help Center
The section below briefs you about the bugs, vulnerabilities, and code issues ... we have created our own checks and rules to discover...
Read more >
Rule overview - Deno
Warns the usage of unknown rule codes in ignore directives. We sometimes have to suppress and ignore lint errors for some reasons. We...
Read more >
FAQ Section - MESA Safe Company
If the safe gives you E-code that means the incorrect code is being entered into the safe and you will need to use...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
Rules in ESLint are grouped by type to help you understand their purpose. ... These rules relate to possible logic errors in code:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found