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.
This commit is contained in:
barsa 2025-12-17 14:10:22 +09:00
parent ce42664965
commit 3fe74b72dd
2 changed files with 7 additions and 1 deletions

View File

@ -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`).

View File

@ -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"]
}