mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:07:40 +01:00
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.
12 lines
248 B
Bash
Executable File
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/
|