From e1e228430fbdd5190310325303bf3b378c8245f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Jul 2026 08:15:06 +0700 Subject: [PATCH] =?UTF-8?q?chore:=20add=20pre-commit=20hook=20with=20husky?= =?UTF-8?q?=20=E2=80=94=20wajib=20lint=20pass=20sebelum=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Install husky v9, init .husky/pre-commit - Hook runs 'bun run lint' and rejects commit on failure - 'bun install' auto-activates hooks via prepare script Co-Authored-By: Claude Opus 5 (1M context) --- .husky/pre-commit | 1 + package.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..444e0e3 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +bun run lint \ No newline at end of file diff --git a/package.json b/package.json index 8b34a42..d7b6fa3 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "test:web-api": "bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts", "test:s3": "bun test --preload ./test/helpers/setup-env.ts test/s3-auth.test.ts && bun test --preload ./test/helpers/setup-env.ts test/s3-operations.test.ts && bun test --preload ./test/helpers/setup-env.ts test/web-api.test.ts", "lint": "bunx biome check src test", - "format": "bunx biome format --write src test" + "format": "bunx biome format --write src test", + "prepare": "husky" }, "dependencies": { "@prisma/engines": "^7.8.0", @@ -31,6 +32,7 @@ "@biomejs/biome": "^2.4.15", "@types/node": "^25.8.0", "drizzle-kit": "^0.31.10", + "husky": "^9.1.7", "typescript": "^6.0.3" } }