Closed hossam-fares closed 6 years ago
LGTM 👍
Thanks Cirpo
On 11 Feb 2018 7:45 pm, "cirpo" notifications@github.com wrote:
LGTM 👍
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/namshi/coding-standards/pull/15#issuecomment-364761112, or mute the thread https://github.com/notifications/unsubscribe-auth/ABw8xa8n4Mu0iNQZDY-mD4BkGSJ6BdPmks5tTwsagaJpZM4R-QCd .
👏
:D Miss you guys! Keep rocking!
Same here :)
I have added eslint coding style rules drived from google code style and fix it to be prettier compatible
So you only need to do:
Running the above command will modify the package.json and install the required dependencies. It will also add the following
npm
scripts:lint-staged
=> This is the actual pre-commit scripts. Whenever you try to commit, it will take the staged files, run eslint and prettier on it, and commit the files.But if we want to format the existing files, we can run :
npm run eslint YOUR_FILE_OR_DIR
npm run prettier YOUR_FILE_OR_DIR
Credit:
Thanks to @shidhincr, we have a very simple way to have code styling fix on pre-commit in this gist https://gist.github.com/shidhincr/3816f8ed5f03c10405892641e60f94d6