I have a question about the naming convention, the styleguide specifies that if the file exports a single class, the name of the file should be the name of the class. (see https://github.com/airbnb/javascript#naming--filename-matches-export)
So something like this:
import CheckBox from './CheckBox';
What about the directory structure? Is there any preference?
Because, these 2 structures are good based on the styleguide, but the import syntax will be different.
├── src
│ ├── CheckBox
│ │ ├── index.js
│ │ ├── CheckBox.js
import CheckBox from './CheckBox';
├── src
│ ├── checkbox
│ │ ├── index.js
│ │ ├── CheckBox.js
import CheckBox from './checkbox';
Does airbnb have a preference?
For internal component, I find it ok to have import with capital letters, but in an external library, it doesn't seem very common to have import CheckBox from 'component-lib/CheckBox';
I have a question about the naming convention, the styleguide specifies that if the file exports a single class, the name of the file should be the name of the class. (see https://github.com/airbnb/javascript#naming--filename-matches-export)
So something like this:
What about the directory structure? Is there any preference?
Because, these 2 structures are good based on the styleguide, but the import syntax will be different.
Does airbnb have a preference?
For internal component, I find it ok to have import with capital letters, but in an external library, it doesn't seem very common to have
import CheckBox from 'component-lib/CheckBox';