Actually I was thinking about some rules that we may consider before submitting any merge requests. And there is a very good repo which is similar to what I want to create here, but we have some different rules, and I want to create this repo just as a sample so you may use some parts of it. As we are using React, Material-ui, [JSS styles] (https://github.com/cssinjs/jss) these rules are related to these projects. We are also using eslint and flow.
- Avoiding console.log
- Using
// @flow
on top of every file - Avoiding eslint errors
- Each component file's name should start with an uppercase letter and the other files should start with a lowercase letter.
- Each component file should have a component with the same name as the file inside it.
- No hard-coded text in files, (should use resources files)
- Avoiding formatting numbers or dates or any mathematical calculations using moment or any other library (should use the related util)
- Instead of using
moment
ormathjs
or similar libraries directly, use their related util file, so whenever we want we can change the library simply.
- Avoiding inline styles in html parts.
- Avoiding hard-coded numbers for width, height, padding, etc. (using theme object introduced by material-ui)
- Avoiding hard-coded colors in styles (using theme object introduced by material-ui)
- Avoiding float: left | right (use flexbox or grid instead)
- Commit messages should be simple and start with module name and a description of what you did on that module e.g. (Customers: adding notifications on create and update)
- Avoid using general commit messages like bug fix, improvement, refactoring etc.