no-unreachable didn't work with single if
See original GitHub issueTell 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:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.