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
Update: make no-lone-blocks report blocks in switch cases (fixes #8047) #8062
Conversation
@not-an-aardvark, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vitorbal, @jrvidal and @btmills to be potential reviewers. |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I think this is the same case as #7879 so it should be a breaking change too. |
This is a slightly different case from #7879. #7879 concerns the curly braces containing switch statement bodies, which can optionally be handled by the |
Fair enough. |
84f061d
to
99d56c2
Compare
LGTM |
I'm not confident, but maybe it should ignore the following case. switch (a) {
case 1:
{
doSomething();
}
break; // SwitchCase has 2 statements and the last one is a BreakStatement.
case 2:
{
doSomething();
}
break;
} |
@mysticatea I think we could add an exception if it's requested. |
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (#8047)
What changes did you make? (Give an overview)
This updates
no-lone-blocks
to report block statements in SwitchCase nodes. As described in #8047, it does not report blocks if they are the only statement in SwitchCase nodes.Is there anything you'd like reviewers to focus on?
Nothing in particular