Last active
August 11, 2021 08:18
-
-
Save ruben1/768dc68b25eeeefff78a2b23cc7680fd to your computer and use it in GitHub Desktop.
Pre-commit git hook for CCI frontend projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install | |
cd <project root> | |
touch .git/hooks/pre-commit # create pre-commit file | |
chmod +x .git/hooks/pre-commit # make it executable | |
# copy pre-commit contents to the file | |
# Use | |
git commit # will trigger the hook. you might see prettier rules fixed after committing | |
git commit --amend -n # after checking prettier changes look good, commit again and skip the hook this time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eo pipefail | |
yarn lint --fix | |
yarn typecheck | |
yarn test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment