Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: optimize husky pre-commit hook to check only staged files #1467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morningxm
Copy link

Currently, the Husky pre-commit hook runs TypeScript (tsc) and linting checks on the entire codebase, which can be time-consuming and inefficient. This PR refactors the pre-commit hook to only check files that are staged for commit, improving performance and reducing unnecessary checks.

Changes:

  • Added prettier for Husky pre-commit hook
  • Updated the Husky pre-commit hook to use lint-staged for running tsc and linting checks.
  • Configured lint-staged to only process staged files, ensuring faster and more targeted checks.

Benefits:

  • Faster pre-commit checks, as only staged files are validated.
  • Reduced unnecessary checks on unchanged files.
  • Improved developer experience with quicker feedback during commits.

@morningxm morningxm changed the title chore: pptimize husky pre-commit hook to check only staged files chore: optimize husky pre-commit hook to check only staged files Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant