-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule "no-fallthrough" falsely triggers when using curly brackets #9559
Comments
Unfortunately, it looks like there wasn't enough interest from the team or community to implement this change. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn't mean the idea isn't interesting or useful, just that it's not something the team can commit to. |
The rule `no-fallthrough` now gets the `SwitchCase` that falls through passed into the function where the comment is found and checked. In that function, if the falllthrough case has a block, it looks for a matching comment inside the block. Also added are corresponding tests and an example in the documentation for the switch case block.
The rule `no-fallthrough` now gets the `SwitchCase` that falls through passed into the function where the comment is found and checked. In that function, if the falllthrough case has a block, it looks for a matching comment inside the block. Also added are corresponding tests and an example in the documentation for the switch case block. Rev
The rule `no-fallthrough` now gets the `fallthroughCase` passed into the function `hasFallthroughComment`. In that function, it looks for the comment directly before the falllthrough case's block in addition to directly before the current case. Also added are corresponding tests and an example in the documentation for the switch case block.
The rule `no-fallthrough` now gets the `fallthroughCase` passed into the function `hasFallthroughComment`. In that function, it looks for the comment directly before the fallthrough case's block in addition to directly before the current case. Also added are corresponding tests and an example in the documentation for the switch case block.
What version are you using?
v4.9.0
What did you do?
Config:
Code:
What happened?
Console (worked as intended):
ESLint:
What did you expect to happen?
The same as without curly brackets, right? Removing the first or all of the case brackets prevents ESLint from erroring out the
no-fallthrough
message.Code:
The empty block looks good for consistency especially since I want to comment something and not "stack" the case statements on top of each other.
The text was updated successfully, but these errors were encountered: