diff --git a/pages/style-guide/js.md b/pages/style-guide/js.md index 56c8b135..77b97b19 100644 --- a/pages/style-guide/js.md +++ b/pages/style-guide/js.md @@ -249,35 +249,43 @@ elements When an entire file is wrapped in a closure, the body of the closure is not indented. ```js -(function( $ ) { +( function( $ ) { -// this doesn't get indented +// This doesn't get indented -})( jQuery ); +} )( jQuery ); +``` + +```js +module.exports = function( grunt ) { + +// This doesn't get indented + +}; ``` The same applies to AMD wrappers. ```js -define([ +define( [ "foo", "bar", "baz" ], function( foo, bar, baz ) { -// this doesn't get indented +// This doesn't get indented -}); +} ); ``` For UMD, the factory is indented to visually differentiate it from the body. ```js -(function( factory ) { +( function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. - define([ + define( [ "jquery" ], factory ); } else { @@ -285,11 +293,11 @@ For UMD, the factory is indented to visually differentiate it from the body. // Browser globals factory( jQuery ); } -}(function( $ ) { +}( function( $ ) { -// this doesn't get indented +// This doesn't get indented -})); +} ) ); ``` ## Assignments