Files
Juan DenisandClaude Opus 4.8 bdffd91361 chore(frontend): Phase 5 §8.5 — add pre-commit ESLint guard
Adds a shared git hook (.githooks/pre-commit) that lints staged frontend JS/JSX
and blocks the commit on ESLint ERRORS only (warnings allowed). It exits early
for commits with no frontend JS/JSX (backend, SCSS, docs), so it never disrupts
those. Enable once per clone: `git config core.hooksPath .githooks` (or
`sh frontend/setup-hooks.sh`).

Chose a committed .githooks script over husky/lint-staged: this is a monorepo
(git root has the Python backend; only frontend/ is a node package with no root
package.json), so a dependency-free hook avoids an npm-install-time git-config
mutation and keeps backend committers unaffected. Documented in AGENTS.md.

Tested: blocks a staged file with a parse error (exit 123), passes when clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:46:28 -04:00

7 lines
294 B
Bash

#!/bin/sh
# Enable the repo's shared git hooks (pre-commit ESLint guard).
# Run once after cloning: sh frontend/setup-hooks.sh
cd "$(git rev-parse --show-toplevel)" || exit 1
git config core.hooksPath .githooks
echo "✓ core.hooksPath set to .githooks — pre-commit ESLint guard is active."