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.
This commit is contained in:
Joe Lencioni
2016-02-03 12:23:51 -08:00
parent 38d9b34b27
commit 4d74fe1f5a

View File

@@ -1281,6 +1281,9 @@ Other Style Guides
function f() {}
break;
}
case 4:
bar();
break;
default: {
class C {}
}