Skip to content

Commit 533e9ea

Browse files
committed
Adding comments about spacing between blocks
1 parent 4503923 commit 533e9ea

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
- Use one `var` declaration per variable.
370370
It's easier to add new variable declarations this way, and you never have
371371
to worry about swapping out a `;` for a `,` or introducing punctuation-only
372-
diffs.
372+
diffs.
373373
374374
```javascript
375375
// bad
@@ -854,6 +854,43 @@
854854
.call(tron.led);
855855
```
856856

857+
- Leave a blank line after blocks and before the next statement
858+
859+
```javascript
860+
// bad
861+
if (true) {
862+
var a = 2;
863+
}
864+
var b = 3;
865+
866+
// good
867+
if (true) {
868+
var a = 2;
869+
}
870+
var b = 3;
871+
872+
// bad
873+
var o = {
874+
foo: function() {
875+
},
876+
bar: function() {
877+
}
878+
};
879+
return o;
880+
881+
// good
882+
var o = {
883+
foo: function() {
884+
},
885+
886+
bar: function() {
887+
}
888+
};
889+
890+
return o;
891+
```
892+
893+
857894
**[⬆ back to top](#table-of-contents)**
858895

859896
## Commas

0 commit comments

Comments
 (0)