Skip to content

Commit

Permalink
Merge pull request airbnb#7 from airbnb/bang_modules
Browse files Browse the repository at this point in the history
Switched modules to bang-style.
  • Loading branch information
hshoff committed Nov 2, 2012
2 parents 7cc3281 + c771d4e commit d5a05ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1083,14 +1083,15 @@
## <a name='modules'>Modules</a>
- 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.
- The file should be named with camelCase, live in a folder with the same name, and match the name of the single export.
- Add a method called noConflict() that sets the exported module to the previous version.
- Always declare `'use strict;'` at the top of the module.

```javascript
// fancyInput/fancyInput.js
(function(global) {
!function(global) {
'use strict';
var previousFancyInput = global.FancyInput;
Expand All @@ -1104,7 +1105,7 @@
};
global.FancyInput = FancyInput;
})(this);
}(this);
```

**[[⬆]](#TOC)**
Expand Down

0 comments on commit d5a05ef

Please sign in to comment.