Open chunming-c opened 6 years ago
hi @Chun-MingChen Thanks for giving me advice! Sorry for not open another PR, because there are some problems have been solve while developing.
btw, I am not sure about where to put helper, so I put it under assets, is it okay? Here is my folder tree right now:
root
├── package.json
├── index.html
└── src
└── assets
| └── helper
| | └── itemFakeDatas.js
| └── style/scss
| └── images
|
└── components
└── index.js
└── store.js
Thanks again!
For assets
folder, it aims for placing static resource like image
, style
or font
etc.
As a rule of thumb, you could re-position your helpers
at the same layer as components
.
You may give a try. For example:
root
├── package.json
├── index.html
└── src
└── assets
| └── style/scss
| └── images
|
└── components
└── helpers
| └── itemFakeDatas.js
└── index.js
└── store.js
Hi @yumeishih
According to basic-web-table-dealing#2 from
CYBAI
, it has mentioned some awesome advices. Those convention like2 space indentation
,comma style
andsingle quote
are significant. The following are my advices and I'll skip the repeated part. Hope it could be useful for you.[x] it had better to reopen the
eslint
inwebpack.config.js
.[x] It's unnecessary to omit
webpack.config.js
in.gitignore
. Also,dist
should be ignored.[x] Position of dependencies
For
dependencies
, it's used for production and the following should be lain indevDependencies
react
, thejavascript files
undersrc
might be categorized toReact Component
. In my opinion,js
folder seems to putthird-party
js and I'll recommend to organize your component by feature like following.ref: https://jaysoo.ca/2016/02/28/organizing-redux-application/#rule-1-organize-by-feature https://github.com/facebookincubator/create-react-app#creating-an-app https://github.com/react-boilerplate/react-boilerplate
[x] filename we select camelCase but lower-case at first letter instead.
[x] always put
react component
incomponents
folders.components/content/itemList.js
seems to be fake data. You could leave it at folderutils
,helper
,fakeData
or something like that.