Skip to content

Feature Request: Add Husky for Pre-Commit Hooks #340

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

Open
shivasankaran18 opened this issue Mar 29, 2025 · 1 comment · May be fixed by #341
Open

Feature Request: Add Husky for Pre-Commit Hooks #340

shivasankaran18 opened this issue Mar 29, 2025 · 1 comment · May be fixed by #341

Comments

@shivasankaran18
Copy link

Feature Request 🛍️

Add Husky for Pre-Commit Hooks

Use Case

Currently, the project uses ESLint, but there are no Git hooks to enforce linting before commits. Additionally, Prettier is proposed in an open PR (#301) but has not yet been merged. Without Git hooks, contributors might commit unformatted or non-linted code, leading to inconsistencies in the codebase.

Adding Husky will ensure that:

  • ESLint runs before every commit.
  • Once Prettier is merged, it can be included in the hook to enforce consistent formatting.
  • Contributors follow coding standards automatically.

Possible Solution

To address this, Husky can be integrated into the project to manage Git hooks, ensuring automated checks before commits. By configuring Husky alongside lint-staged, we can enforce ESLint rules on staged files, maintaining code consistency and quality. Additionally, a pre-commit hook will be added to run TypeScript type checks and unit tests, preventing broken code from entering the repository. Once Prettier is merged, we can extend the hook to include formatting checks. This approach streamlines the development workflow while reducing the likelihood of linting or formatting issues in committed code.

Context

  • This change will prevent contributors from committing incorrectly linted code.
  • It will help maintain consistent code quality across the project.
  • The use of lint-staged ensures that only staged files are checked, keeping the process fast and efficient.

Detailed Description

@shivasankaran18
Copy link
Author

@DianaLease @dselman @ekarademir I would like to work on this issue ..

@shivasankaran18 shivasankaran18 linked a pull request Mar 29, 2025 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant