chore: add pre-commit hooks with lint-staged (#1465)

Co-authored-by: cpacker <packercharles@gmail.com>
Co-authored-by: Letta Code <noreply@letta.com>
This commit is contained in:
Kian Jones
2026-03-23 15:29:31 -07:00
committed by GitHub
parent bd5ed72f92
commit 807b28cd1e
3 changed files with 15 additions and 2 deletions

8
.husky/install.mjs Normal file
View File

@@ -0,0 +1,8 @@
if (process.env.NODE_ENV === "production" || process.env.CI === "true") {
process.exit(0);
}
try {
const husky = (await import("husky")).default;
husky();
} catch {}

View File

@@ -1,3 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Run the same checks as CI to ensure parity
bun run check # Lint staged files only (fast)
bunx lint-staged
# Typecheck full project (catches type errors in unchanged files)
bun run typecheck

View File

@@ -64,6 +64,7 @@
"typescript": "^5.0.0" "typescript": "^5.0.0"
}, },
"scripts": { "scripts": {
"prepare": "node .husky/install.mjs",
"lint": "bunx --bun @biomejs/biome@2.2.5 check src", "lint": "bunx --bun @biomejs/biome@2.2.5 check src",
"fix": "bunx --bun @biomejs/biome@2.2.5 check --write src", "fix": "bunx --bun @biomejs/biome@2.2.5 check --write src",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",