From 3fe74b72dd916d41d4181ecba858102f70640b2b Mon Sep 17 00:00:00 2001 From: barsa Date: Wed, 17 Dec 2025 14:10:22 +0900 Subject: [PATCH] Enhance pre-commit hook for improved linting and type checking - Added commands to stage modified tracked files and run lint-staged for auto-fixing issues. - Included a type check step to ensure code quality before commits. --- .husky/pre-commit | 6 ++++++ .lintstagedrc.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 087f7e62..a069af19 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,10 @@ +# Stage all modified tracked files (includes manual fixes to already-staged files) +git add -u + +# Run lint-staged on staged files (checks linting, formats with prettier, and re-stages) pnpm lint-staged + +# Run type check pnpm type-check # Security audit is enforced in CI (`.github/workflows/security.yml`). diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 49351bb5..3b7645df 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,4 @@ { - "*.{ts,tsx,js,jsx}": ["eslint --fix", "prettier -w"], + "*.{ts,tsx,js,jsx}": ["eslint", "prettier -w"], "*.{json,md,yml,yaml,css,scss}": ["prettier -w"] }