echo "π Running pre-commit hook to check the code looks good... π" | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Load nvm if you're using i | |
echo "Running typecheck..." | |
which pnpm | |
if ! pnpm typecheck; then | |
echo "β Type checking failed! Please review TypeScript types." | |
echo "Once you're done, don't forget to add your changes to the commit! π" | |
echo "Typecheck exit code: $?" | |
exit 1 | |
fi | |
echo "Running lint..." | |
if ! pnpm lint; then | |
echo "β Linting failed! 'pnpm lint:fix' will help you fix the easy ones." | |
echo "Once you're done, don't forget to add your beautification to the commit! π€©" | |
echo "lint exit code: $?" | |
exit 1 | |
fi | |
echo "π All good! Committing changes..." | |