File tree 1 file changed +19
-11
lines changed
1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -246,47 +246,55 @@ elements
246
246
When an entire file is wrapped in a closure, the body of the closure is not indented.
247
247
248
248
``` js
249
- (function ( $ ) {
249
+ ( function ( $ ) {
250
250
251
- // this doesn't get indented
251
+ // This doesn't get indented
252
252
253
- })( jQuery );
253
+ } )( jQuery );
254
+ ```
255
+
256
+ ``` js
257
+ module .exports = function ( grunt ) {
258
+
259
+ // This doesn't get indented
260
+
261
+ };
254
262
```
255
263
256
264
The same applies to AMD wrappers.
257
265
258
266
``` js
259
- define ([
267
+ define ( [
260
268
" foo" ,
261
269
" bar" ,
262
270
" baz"
263
271
], function ( foo , bar , baz ) {
264
272
265
- // this doesn't get indented
273
+ // This doesn't get indented
266
274
267
- });
275
+ } );
268
276
```
269
277
270
278
For UMD, the factory is indented to visually differentiate it from the body.
271
279
272
280
``` js
273
- (function ( factory ) {
281
+ ( function ( factory ) {
274
282
if ( typeof define === " function" && define .amd ) {
275
283
276
284
// AMD. Register as an anonymous module.
277
- define ([
285
+ define ( [
278
286
" jquery"
279
287
], factory );
280
288
} else {
281
289
282
290
// Browser globals
283
291
factory ( jQuery );
284
292
}
285
- }(function ( $ ) {
293
+ }( function ( $ ) {
286
294
287
- // this doesn't get indented
295
+ // This doesn't get indented
288
296
289
- }) );
297
+ } ) );
290
298
```
291
299
292
300
## Equality
You can’t perform that action at this time.
0 commit comments