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.

Support braces for no-fallthrough

See original GitHub issue

What version of ESLint are you using? 3.0.1 What rule do you want to change? no-fallthrough What code should be flagged as correct with this change?

/*eslint no-fallback: ["error", { "commentPattern": "[\\w\\s]*fallthrough" }]*/
var foo = ...;
switch(bar) {
    case 0: {
      if (typeof(foo) == 'string')
        return doSomething();
      // Otherwise, fallthrough
    }
    default:
      doSomethingElse();
}

What happens when the rule is applied to this code now? Errors: Expected a ‘break’ statement before ‘default’.

… Basically I am asking for the rule to support case statements that contain braces.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ilyavolodincommented, Jul 11, 2017

@cowwoc what @not-an-aardvark means is consensus from the team. Every proposed change has to be supported by 3 team members and championed by one. Unfortunately, in this case, none of the team members elected to support this change other then @platinumazure As @not-an-aardvark message mentions, we found that if the issue doesn’t gain support shortly after being created, it’s most likely will be forgotten and will never gain support required for implementation:-( That’s why we periodically close older issues.

0reactions
j-f1commented, Aug 9, 2017

This has been brought up again in #9080.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OTC Wrist Splint, Adult Support Brace, Large, 8 Inch (Left Hand)
Minimum - Compressive support only. For optimal comfort and range of motion. Use after recovery to prevent injury on weak aching muscles and...
Read more >
GCC 7, -Wimplicit-fallthrough warnings, and portable way to ...
The GCC manual states to use __attribute__ ((fallthrough)) , but its not portable. The manual also states "... it is also possible to...
Read more >
7.5 — Switch fallthrough and scoping - Learn C++
To specify an attribute, the attribute name is placed between double hard braces. Attributes are not statements -- rather, they can be used ......
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
Other library implementations may not support all these features; GCC does ... C++17 provides a standard way to suppress the -Wimplicit-fallthrough warning ...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
Rules in ESLint are grouped by type to help you understand their purpose. ... no-fallthrough ... Require braces around arrow function bodies. Categories:....
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