diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..a9343f42 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,15 @@ +if [ "$NO_VERIFY" ]; then + echo 'pre-commit hook skipped' 1>&2 + exit 0 +fi + +echo '--- check code style ---' +pnpm exec lint-staged + +echo '--- run typescript check ---' +pnpm check-types + +echo '--- run tests ---' +# CI=1 disallows `.only` in tests +# --changed only runs the tests affected by changed files +CI=1 pnpm exec vitest run --changed --passWithNoTests