Skip to content

Commit d5a05ef

Browse files
committed
Merge pull request airbnb#7 from airbnb/bang_modules
Switched modules to bang-style.
2 parents 7cc3281 + c771d4e commit d5a05ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,14 +1083,15 @@
10831083
10841084
## <a name='modules'>Modules</a>
10851085
1086+
- The module should start with a `!`. This ensures that if a malformed module forgets to include a final semicolon there aren't errors in production when the scripts get concatenated.
10861087
- The file should be named with camelCase, live in a folder with the same name, and match the name of the single export.
10871088
- Add a method called noConflict() that sets the exported module to the previous version.
10881089
- Always declare `'use strict;'` at the top of the module.
10891090

10901091
```javascript
10911092
// fancyInput/fancyInput.js
10921093
1093-
(function(global) {
1094+
!function(global) {
10941095
'use strict';
10951096
10961097
var previousFancyInput = global.FancyInput;
@@ -1104,7 +1105,7 @@
11041105
};
11051106
11061107
global.FancyInput = FancyInput;
1107-
})(this);
1108+
}(this);
11081109
```
11091110

11101111
**[[⬆]](#TOC)**

0 commit comments

Comments
 (0)