Support braces for no-fallthrough
See original GitHub issueWhat 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:
- Created 7 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top 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 >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
@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.
This has been brought up again in #9080.