Skip to content

Commit 19fe3f5

Browse files
AndresAndres
Andres
authored and
Andres
committed
Adding whitespaces for arrays and hashes
1 parent 55a6737 commit 19fe3f5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ Avoid extraneous whitespace in the following situations:
108108
console.log x , y # No
109109
```
110110

111+
Except when:
112+
113+
- Creating a new array with one or more elements
114+
115+
```coffeescript
116+
a = [ 1, 2, 3 ] # Yes
117+
a = [1, 2, 3] # No
118+
```
119+
120+
- Creating a new object (hash) with one or more key-value pairs
121+
122+
```coffeescript
123+
h = { a: 1, b: 2, c: 3 } # Yes
124+
h = {a: 1, b: 2, c: 3} # No
125+
```
126+
111127
Additional recommendations:
112128

113129
- Always surround these binary operators with a **single space** on either side

0 commit comments

Comments
 (0)