Skip to content

Commit df589ca

Browse files
committed
Merge pull request polarmobile#25 from am/master
Avoid optional commas before newlines.
2 parents 3dd8c5a + c23f97f commit df589ca

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The details in this guide have been very heavily inspired by several existing st
2626
* [Maximum Line Length](#maximum_line_length)
2727
* [Blank Lines](#blank_lines)
2828
* [Trailing Whitespace](#trailing_whitespace)
29+
* [Optional Commas](#optional_commas)
2930
* [Encoding](#encoding)
3031
* [Module Imports](#module_imports)
3132
* [Whitespace in Expressions and Statements](#whitespace)
@@ -69,6 +70,33 @@ Use a single blank line within the bodies of methods or functions in cases where
6970

7071
Do not include trailing whitespace on any lines.
7172

73+
<a name="optional_commas"/>
74+
### Optional Commas
75+
76+
Avoid the use of commas before newlines when properties or elements of an Object or Array are listed on separate lines.
77+
78+
```coffeescript
79+
# Yes
80+
foo = [
81+
'some'
82+
'string'
83+
'values'
84+
]
85+
bar:
86+
label: 'test'
87+
value: 87
88+
89+
# No
90+
foo = [
91+
'some',
92+
'string',
93+
'values'
94+
]
95+
bar:
96+
label: 'test',
97+
value: 87
98+
```
99+
72100
<a name="encoding"/>
73101
### Encoding
74102

0 commit comments

Comments
 (0)