-
Notifications
You must be signed in to change notification settings - Fork 5
Coding Conventions
Kenza Boulisfane edited this page Mar 7, 2020
·
4 revisions
It is very important for the development team to follow the coding conventions agreed upon to ensure very high code quality and overall consistency.
ESLint is a tool that allows us to maintain code quality and enforce code conventions. It is a static code evaluator, which means that it does not actually execute the code but reads through it instead to check if all the preconfigured code conventions are followed by the developers.
npm install eslint --save-devnpm install eslint-plugin-react --save-dev
We have chosen to use the following basic coding conventions:
- Semicolons at the end of each line
- Double quotes over single quotes
- use const to define functions
- To see which files need to be fixed along with exactly what errors need to be resolved, use the following command:
npm run lint
- To fix most of the errors (some of them need to be fixed manually):
npm run lint:fix
- Folder names should start with a lower case letter.
- Components should start with an upper case letter.
- Object and variable declarations should always be in camel case (ex: camelCase).
- Each commit should reference the issue it is solving. The issue number can be added to the commit message.