diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..fc01a6c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,9 @@ +echo "👉 Running lint (frontend)..." +cd frontend || exit 1 +npm run lint || { + echo "❌ Lint failed, push aborted." + exit 1 +} + +cd - || exit 1 +echo "✅ All frontend checks passed." \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push index d34d737..c0197ac 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,14 +1,15 @@ -#!/usr/bin/env node - -const { execSync } = require("child_process"); +echo "👉 Running lint (frontend)..." +cd frontend || exit 1 +npm run lint || { + echo "❌ Lint failed, push aborted." + exit 1 +} -try { - console.log("👉 Running lint (frontend)..."); - execSync("cd frontend && npm run lint", { stdio: "inherit" }); - console.log("👉 Running lhci (frontend)..."); - execSync("cd frontend && npm run lhci autorun", { stdio: "inherit" }); - console.log("✅ All frontend checks passed."); -} catch (err) { - console.error("❌ Checks failed, push aborted."); - process.exit(1); +echo "👉 Running lhci (frontend)..." +npm run lhci autorun || { + echo "❌ LHCI checks failed, push aborted." + exit 1 } + +cd - || exit 1 +echo "✅ All frontend checks passed." \ No newline at end of file