Skip to content

Commit b47a1c0

Browse files
committed
Fix blocks style
1 parent 78309e7 commit b47a1c0

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,30 +613,40 @@
613613
614614
## Blocks
615615
616-
- Use braces with all multi-line blocks.
616+
- Use braces with all blocks.
617617
618618
```javascript
619619
// bad
620620
if (test)
621621
return false;
622-
623-
// good
622+
623+
// bad
624624
if (test) return false;
625625

626626
// good
627627
if (test) {
628628
return false;
629629
}
630-
630+
```
631+
- Avoid one line blocks
632+
633+
```javascript
631634
// bad
632635
function() { return false; }
633636

634637
// good
635638
function() {
636639
return false;
637640
}
638-
```
641+
642+
// bad
643+
if (test) { return false; }
639644

645+
// good
646+
if (test) {
647+
return false;
648+
}
649+
```
640650
- If you're using multi-line blocks with `if` and `else`, put `else` on the same line as your
641651
`if` block's closing brace.
642652

0 commit comments

Comments
 (0)