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-unreachable didn't work with single if

See original GitHub issue

Tell us about your environment

  • ESLint Version: 3.19.0
  • Node Version: 6.10.2
  • npm Version:

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

Please show your full configuration:

const ERROR = 2

module.exports = {
    rules: {
      'no-unreachable': [ERROR]
    }
};

What did you do? Please include the actual source code causing the issue.

function foo() {
  if (true) {
    return
  }
  return
}

What did you expect to happen? ESLint report a no-unreachable error What actually happened? Please include the actual, raw output from ESLint. Lint passed

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, Apr 25, 2017

while (false)

Hmm, I hadn’t realized we don’t catch that case either. This seems like something we should do, but if it’s just used for detecting loops then I suppose it’s an enhancement rather than a bug.

0reactions
not-an-aardvarkcommented, Jul 11, 2017

Closing this as it doesn’t appear that there is enough interest, either from the team or from the community, to implement this at this time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unreachable code in an if statement - java - Stack Overflow
Your elseif condition is unreachable as you have declared if(condition) inside a loop but using elseif(condition) outside the loop.
Read more >
Taints and Tolerations | Kubernetes
Node affinity is a property of Pods that attracts them to a set of nodes (either as a preference or a hard requirement)....
Read more >
Frequently Asked Questions About Your Online Account - IRS
Online account shows details for any federal tax liability associated with your individual account, such as: Income tax owed on your Form 1040;...
Read more >
Find your lost AirPods - Apple Support
On your iPhone, iPad, or iPod touch, open the Find My app. Go to the Devices tab, and choose your AirPods. Scroll down...
Read more >
Python Strings | Python Education - Google Developers
String literals can be enclosed by either double or single quotes, although single quotes are more commonly used. Backslash escapes work the ...
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