This code specification is for better personal code habit and better team collaboration.
Read this in other languages: 简体中文.
This code specifications contains following two characters:
- Standard local coding:
- We use Editorconfig for basic format support. Refer to config files .editorconfig .
- We use Prettier and VSCode editor setting
editor.formatOnSave
for format code at coding time. Refer to config files .prettierrc.js . - We use ESLint to complement Prettier. Refer to config files .eslintrc.json .
- Staged files check:
- We use husky to work with Git hooks for running some commands such as Lint, Test, etc .
- We use lint-staged to work with files to be committed for better performance.
As this code specifications strongly depend on code editor VSCode , so we need install it.
Also, we need install several VSCode plugins: Prettier , ESLint , EditorConfig .
Just clone this repository to your local machine and then install related dependencies.
git clone https://github.com/dhucst/code-specifications.git
cd code-specifications && npm install
And then enjoying standard happy coding.
We want contributing to this code specifications to be fun, enjoyable, and educational for anyone, and everyone. You just need the following steps:
Fork this repository.
Clone this forked repository to your local machine.
And then clone this repository, add your improvement and make a PR.
git clone https://github.com/pftom/code-specifications.git
cd code-specifications && npm install