diff --git a/js/.husky/pre-commit b/js/.husky/pre-commit index 24f1b40ca6..597d414f60 100755 --- a/js/.husky/pre-commit +++ b/js/.husky/pre-commit @@ -7,4 +7,14 @@ if [ ! -f "$FILE" ]; then exit 0; fi +# Exit if dependencies are not installed. +if [ ! -d "node_modules" ]; then + exit 0; +fi + +# Exit if pnpm is not installed. +if ! [ -x "$(command -v pnpm)" ]; then + exit 0; +fi + pnpm exec lint-staged