Skip to content

Commit 4d74fe1

Browse files
committed
Add example of a case clause that does not need a block
As @kesne and @ljharb pointed out, this section was unclear about whether or not you should always include blocks for all case clauses. To make things clearer, I am adding a case clause that does not need a block to the good example. We decided that we should only require blocks for case clauses that actually need them because it matches the as-needed spirit of section 3.8 ("Only quote properties that are invalid identifiers"). Perhaps if there was an as-needed but consistent setting for the ESLint rule, we would consider revising this a little, but this seems good enough for now.
1 parent 38d9b34 commit 4d74fe1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,9 @@ Other Style Guides
12811281
function f() {}
12821282
break;
12831283
}
1284+
case 4:
1285+
bar();
1286+
break;
12841287
default: {
12851288
class C {}
12861289
}

0 commit comments

Comments
 (0)