mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-13 22:38:08 -05:00
Use modules in naming conventions example
Following the rule from further up: "Always use modules (import/export) over a non-standard module system."
This commit is contained in:
committed by
Josh Perez
parent
0cca5e21fc
commit
e5006931f1
@@ -1704,17 +1704,17 @@
|
||||
class CheckBox {
|
||||
// ...
|
||||
}
|
||||
module.exports = CheckBox;
|
||||
export default CheckBox;
|
||||
|
||||
// in some other file
|
||||
// bad
|
||||
const CheckBox = require('./checkBox');
|
||||
import CheckBox from './checkBox';
|
||||
|
||||
// bad
|
||||
const CheckBox = require('./check_box');
|
||||
import CheckBox from './check_box';
|
||||
|
||||
// good
|
||||
const CheckBox = require('./CheckBox');
|
||||
import CheckBox from './CheckBox';
|
||||
```
|
||||
|
||||
- Use camelCase when you export-default a function. Your filename should be identical to your function's name.
|
||||
|
||||
Reference in New Issue
Block a user