chore: add pre-commit guardrails #6

Merged
Noel merged 3 commits from feat/pre-commit-hooks into main 2026-10-18 17:25:59 +00:00
Showing only changes of commit 81d658a871 - Show all commits
+10 -3
View File
@@ -55,15 +55,22 @@ repos:
# --------------------------------------------------------- ESLint (Nuxt) -
# Local hook: needs `pnpm install` to have run in this repo. --fix makes
# it a helper; only staged files are linted (fast).
# it a helper; only staged files are linted (fast). When --fix rewrites
# a staged file, pre-commit aborts the commit ("files were modified") -
# re-stage and commit again; that re-stage loop is the standard price
# of a fixer hook.
- repo: local
hooks:
- id: eslint
name: eslint --fix (staged files)
entry: bash -c 'pnpm exec eslint --fix'
# no shell wrapper: pre-commit appends the staged filenames to the
# entry itself. A 'bash -c' wrapper would eat the first filename
# as $0 and eslint would get no file arguments at all (linting the
# whole repo instead - review finding on this PR, empirically
# verified).
entry: pnpm exec eslint --fix
language: system
files: \.(vue|ts|js|mjs|cjs)$
types: [file]
# When Go services arrive, add:
# - repo: https://github.com/dnephin/pre-commit-golang