Skip to content

Commit b3e83dc

Browse files
author
Spike Brehm
committed
Merge pull request airbnb#249 from justjake/jake/react-style
If your file exports a single class, your filename should be exactly the name of the class.
2 parents 20cce8f + e9b5732 commit b3e83dc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,25 @@
12081208

12091209
- **Note:** IE8 and below exhibit some quirks with named function expressions. See [http://kangax.github.io/nfe/](http://kangax.github.io/nfe/) for more info.
12101210

1211+
- If your file exports a single class, your filename should be exactly the name of the class.
1212+
```javascript
1213+
// file contents
1214+
class CheckBox {
1215+
// ...
1216+
}
1217+
module.exports = CheckBox;
1218+
1219+
// in some other file
1220+
// bad
1221+
var CheckBox = require('./checkBox');
1222+
1223+
// bad
1224+
var CheckBox = require('./check_box');
1225+
1226+
// good
1227+
var CheckBox = require('./CheckBox');
1228+
```
1229+
12111230
**[⬆ back to top](#table-of-contents)**
12121231

12131232

0 commit comments

Comments
 (0)