fix: run eslint on every commit and restore gdpr navigation eslint-disable
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:
+10
-9
@@ -14,22 +14,23 @@ NC='\033[0m' # No Colour
|
|||||||
FAILED=0
|
FAILED=0
|
||||||
|
|
||||||
# ---------- Frontend (prettier —write, then eslint) ----------
|
# ---------- Frontend (prettier —write, then eslint) ----------
|
||||||
FRONTEND_FILES=$(git diff --cached --name-only -- 'frontend/' | head -1)
|
FRONTEND_STAGED=$(git diff --cached --name-only -- 'frontend/' | head -1)
|
||||||
if [ -n "$FRONTEND_FILES" ]; then
|
if [ -n "$FRONTEND_STAGED" ]; then
|
||||||
printf "${YELLOW}Auto-formatting staged frontend files with prettier...${NC}\n"
|
printf "${YELLOW}Auto-formatting staged frontend files with prettier...${NC}\n"
|
||||||
cd frontend && npx prettier --write . 2>&1
|
cd frontend && npx prettier --write . 2>&1
|
||||||
# Re-stage any files prettier modified so formatting is included in the commit
|
# Re-stage any files prettier modified so formatting is included in the commit
|
||||||
cd ..
|
cd ..
|
||||||
git diff --name-only -- 'frontend/' | xargs -r git add
|
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
|
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 (go vet) ----------
|
||||||
BACKEND_FILES=$(git diff --cached --name-only -- 'backend/' | head -1)
|
BACKEND_FILES=$(git diff --cached --name-only -- 'backend/' | head -1)
|
||||||
if [ -n "$BACKEND_FILES" ]; then
|
if [ -n "$BACKEND_FILES" ]; then
|
||||||
|
|||||||
@@ -253,6 +253,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleGotoAccount() {
|
function handleGotoAccount() {
|
||||||
|
// eslint-disable-next-line svelte/no-navigation-without-resolve
|
||||||
goto('/account');
|
goto('/account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user