Files
loki/.husky/pre-commit
T
g-but 16dfdc0c88 fix(home): lint clean — convert require() to top-level imports + extend pre-commit to home/
home/log.ts:selfTest used `require("node:os")` and `require("node:crypto")`
to avoid adding top-level imports for test-only deps. Eslint's
@typescript-eslint/no-require-imports flagged both as errors. The
pre-commit hook only ran `eslint src/` so it never caught them.

Two fixes in one commit:
  • Moved the imports to top-level alongside the existing fs + path
    imports. randomUUID is named-imported (matches the existing
    home/emit.ts style); os stays default-imported.
  • Extended .husky/pre-commit's eslint step from 'src/' to 'src/ home/'
    so future home/ lint regressions can't slip through.

Three remaining cryp.randomUUID() callsites and the import block all
updated together. tsc clean, eslint clean, home/log 6/6 still green.
2026-05-20 07:28:56 +02:00

12 lines
248 B
Bash
Executable File

#!/usr/bin/env sh
# Run quick correctness checks on every commit. Smoke runs in pre-push
# (when the local server is up) — see .husky/pre-push.
set -e
echo "→ tsc --noEmit"
npx tsc --noEmit
echo "→ eslint src/ home/"
npx eslint src/ home/