diff --git a/.githooks/pre-commit b/.githooks/pre-commit index c683d0b..0415670 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -14,22 +14,23 @@ NC='\033[0m' # No Colour FAILED=0 # ---------- Frontend (prettier —write, then eslint) ---------- -FRONTEND_FILES=$(git diff --cached --name-only -- 'frontend/' | head -1) -if [ -n "$FRONTEND_FILES" ]; then +FRONTEND_STAGED=$(git diff --cached --name-only -- 'frontend/' | head -1) +if [ -n "$FRONTEND_STAGED" ]; then printf "${YELLOW}Auto-formatting staged frontend files with prettier...${NC}\n" cd frontend && npx prettier --write . 2>&1 # Re-stage any files prettier modified so formatting is included in the commit cd .. git diff --name-only -- 'frontend/' | xargs -r git add - - printf "${YELLOW}Checking eslint...${NC}\n" - if ! cd frontend && npx eslint . 2>&1; then - printf "${RED}✖ eslint failed${NC}\n" - FAILED=1 - fi - cd .. fi +# Always run eslint — catches pre-existing issues that would fail the pipeline +printf "${YELLOW}Checking eslint (all files)...${NC}\n" +if ! cd frontend && npx eslint . 2>&1; then + printf "${RED}✖ eslint failed${NC}\n" + FAILED=1 +fi +cd .. + # ---------- Backend (go vet) ---------- BACKEND_FILES=$(git diff --cached --name-only -- 'backend/' | head -1) if [ -n "$BACKEND_FILES" ]; then diff --git a/frontend/src/routes/gdpr/+page.svelte b/frontend/src/routes/gdpr/+page.svelte index 527a4e6..ce140e7 100644 --- a/frontend/src/routes/gdpr/+page.svelte +++ b/frontend/src/routes/gdpr/+page.svelte @@ -253,6 +253,7 @@ } function handleGotoAccount() { + // eslint-disable-next-line svelte/no-navigation-without-resolve goto('/account'); }