From 4d74fe1f5ab7e2f67e4ad837387debbf276e3929 Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Wed, 3 Feb 2016 12:23:51 -0800 Subject: [PATCH] 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. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 381d5c6b..9920eba7 100644 --- a/README.md +++ b/README.md @@ -1281,6 +1281,9 @@ Other Style Guides function f() {} break; } + case 4: + bar(); + break; default: { class C {} }