Files
plugins/.githooks/pre-commit
T
chrnx efffaebb96 build: npm and Deno workspace with core's gates
Same lint, format and complexity gates as core, plus a lint rule that keeps
core a types-only import in plugin sources. Runtime suites are chosen from each
package's engines, so declaring a runtime is what puts a package under its test.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-17 23:00:49 -05:00

15 lines
501 B
Bash
Executable File

#!/bin/sh
# Pre-commit gate. Auto-fixes formatting and lint on staged TypeScript, re-stages it, then enforces lint
# and the complexity gate. Enabled by the `prepare` script (`git config core.hooksPath .githooks`).
set -e
staged=$(git diff --cached --name-only --diff-filter=ACM -- 'packages/*.ts' 'test/*.ts')
if [ -n "$staged" ]; then
echo "$staged" | xargs npx prettier --write
echo "$staged" | xargs npx eslint --fix
echo "$staged" | xargs git add
fi
npm run lint
npm run complexity:check