Switch cases whose block statements consists of a single block no longer have that block broken and indented. This aligns such switch cases with the way Prettier JavaScript formats them, and no longer violates the Checkstyle that Prettier Java provides.
Example
Input
class Example {
void example() {
switch (a) {
case 1:
{}
case 2:
{
b();
}
case 3:
{
c();
}
{
d();
}
case 4:
e();
{
f();
}
case 5:
{
g();
}
h();
}
}
}
Output
class Example {
void example() {
switch (a) {
case 1: {}
case 2: {
b();
}
case 3:
{
c();
}
{
d();
}
case 4:
e();
{
f();
}
case 5:
{
g();
}
h();
}
}
}
What changed with this PR:
Switch cases whose block statements consists of a single block no longer have that block broken and indented. This aligns such switch cases with the way Prettier JavaScript formats them, and no longer violates the Checkstyle that Prettier Java provides.
Example
Input
Output
Relative issues or prs:
Closes #635