branch="$(git rev-parse --abbrev-ref HEAD)" if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then echo "❌ You can't commit directly to $branch" exit 1 fi yarn dlx lint-staged