diff --git a/js/.husky/pre-commit b/js/.husky/pre-commit index 597d414f60..794e85077a 100755 --- a/js/.husky/pre-commit +++ b/js/.husky/pre-commit @@ -17,4 +17,13 @@ if ! [ -x "$(command -v pnpm)" ]; then exit 0; fi +echo "Running pre-commit hook…"; + +# Ensure latest dependencies are installed, and exit if unable to install. +pnpm install --reporter=silent || { + echo "Unable to install dependencies, skipping pre-commit hook."; + exit 0; +} + +# Run lint-staged. pnpm exec lint-staged