diff --git a/.husky/install.mjs b/.husky/install.mjs new file mode 100644 index 0000000..86a98a7 --- /dev/null +++ b/.husky/install.mjs @@ -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 {} diff --git a/.husky/pre-commit b/.husky/pre-commit index 5bbf70e..d5ea074 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,7 @@ #!/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 diff --git a/package.json b/package.json index 14e7296..e498c56 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "typescript": "^5.0.0" }, "scripts": { + "prepare": "node .husky/install.mjs", "lint": "bunx --bun @biomejs/biome@2.2.5 check src", "fix": "bunx --bun @biomejs/biome@2.2.5 check --write src", "typecheck": "tsc --noEmit",