fix: run eslint on every commit and restore gdpr navigation eslint-disable
CI / Go vulnerabilities (push) Successful in 29s
CI / Frontend lint & types (push) Successful in 1m37s
CI / Tests (push) Successful in 1m50s
CI / Race detector (push) Successful in 3m48s

Pre-commit hook now runs eslint on all frontend files regardless of what's staged, catching pre-existing issues. Restore the necessary eslint-disable in gdpr page for the async goto call.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-07-05 22:43:48 +01:00
co-authored by Sisyphus
parent 878624e6f2
commit 1c09e4220b
2 changed files with 11 additions and 9 deletions
+10 -9
View File
@@ -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
+1
View File
@@ -253,6 +253,7 @@
}
function handleGotoAccount() {
// eslint-disable-next-line svelte/no-navigation-without-resolve
goto('/account');
}