@@ -102,6 +102,33 @@ try {
102
102
} catch ( e ) {
103
103
// Expressions
104
104
}
105
+
106
+ array = [ " *" ];
107
+
108
+ array = [ a, b ];
109
+
110
+ foo ( arg );
111
+
112
+ foo ( options, object[ property ] );
113
+
114
+ foo ( [ a, b ], " property" , { c: d } );
115
+
116
+ foo ( { a: " alpha" , b: " beta" } );
117
+
118
+ foo ( [ a, b ] );
119
+
120
+ foo ( {
121
+ a: " alpha" ,
122
+ b: " beta"
123
+ } );
124
+
125
+ foo ( function () {
126
+ // Do stuff
127
+ }, options );
128
+
129
+ foo ( data, function () {
130
+ // Do stuff
131
+ } );
105
132
```
106
133
107
134
@@ -172,55 +199,6 @@ array = [
172
199
```
173
200
174
201
175
- ### Array and Function Call Spacing
176
-
177
- Always include extra spaces around elements and arguments:
178
-
179
- ``` js
180
- array = [ " *" ];
181
-
182
- array = [ a, b ];
183
-
184
- foo ( arg );
185
-
186
- foo ( " string" , object );
187
-
188
- foo ( options, object[ property ] );
189
-
190
- foo ( node, " property" , 2 );
191
-
192
- foo ( [ a, b ], " property" , { c: d } );
193
- ```
194
-
195
- Exceptions:
196
-
197
- ``` js
198
- // Function with a single line object or array as the sole argument:
199
- // No space on either side of the argument
200
- foo ({ a: " alpha" , b: " beta" });
201
- foo ([ a, b ]);
202
-
203
- // Function with a multiline callback, object, or array as the sole argument:
204
- // No space on either side of the argument
205
- foo ({
206
- a: " alpha" ,
207
- b: " beta"
208
- });
209
-
210
- // Function with a multiline callback, object, or array as the first argument:
211
- // No space before the first argument
212
- foo (function () {
213
- // Do stuff
214
- }, options );
215
-
216
- // Function with a multiline callback, object, or array as the last argument:
217
- // No space after after the last argument
218
- foo ( data, function () {
219
- // Do stuff
220
- });
221
- ```
222
-
223
-
224
202
### Multi-line Statements
225
203
226
204
When a statement is too long to fit on one line, line breaks must occur after an operator.
0 commit comments