Skip to content

Commit c771d4e

Browse files
committed
Switched modules to bang-style.
1 parent ca0f5ff commit c771d4e

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
@@ -1085,14 +1085,15 @@
10851085

10861086
## <a name='modules'>Modules</a>
10871087

1088+
- 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.
10881089
- The file should be named with camelCase, live in a folder with the same name, and match the name of the single export.
10891090
- Add a method called noConflict() that sets the exported module to the previous version.
10901091
- Always declare `'use strict;'` at the top of the module.
10911092
10921093
```javascript
10931094
// fancyInput/fancyInput.js
10941095
1095-
(function(global) {
1096+
!function(global) {
10961097
'use strict';
10971098
10981099
var previousFancyInput = global.FancyInput;
@@ -1106,7 +1107,7 @@
11061107
};
11071108
11081109
global.FancyInput = FancyInput;
1109-
})(this);
1110+
}(this);
11101111
```
11111112
11121113
**[[⬆]](#TOC)**

0 commit comments

Comments
 (0)