Luson045/medi-connect

[Feat] : Implement Pre-commit Hooks for ESLint and Prettier in Backend

Closed this issue · 3 comments

Is there an existing issue for this?

  • I have searched the existing issues

Feature Description

Problem:

Currently, our backend code lacks consistent formatting and linting, which can lead to code quality issues and increased difficulty in maintaining the codebase.

Proposed Solution:

I suggest implementing pre-commit hooks using Husky and lint-staged to ensure that both ESLint and Prettier run automatically before each commit. This will help maintain code quality by enforcing consistent styling and catching potential errors early in the development process.

Use Case

  1. Enforce Code Quality: Automatically catch errors before they hit the codebase.
  2. Consistent Formatting: Ensure everyone’s code looks the same for easier readability.
  3. Automated Fixes: Let ESLint and Prettier handle quick fixes, saving developers time.
  4. CI/CD Integration: Keep coding standards in check during merges and deployments.
  5. Better Team Collaboration: Promote a shared understanding of coding practices.
  6. Faster Code Reviews: Reviewers can focus on logic instead of formatting issues.

Benefits

  1. Improved Code Quality: Catch bugs early to reduce issues in production.
  2. Reduced Technical Debt: Prevent style inconsistencies from piling up.
  3. Increased Developer Productivity: Spend less time on manual formatting.
  4. Enhanced Collaboration: Help new team members onboard quickly.
  5. Clear Coding Standards: Document what’s expected from everyone.
  6. Continuous Feedback: Get immediate feedback on your code as you write.

Priority

Medium

Record

  • I agree to follow this project's Code of Conduct
  • I'm a GSSOC contributor
  • I want to work on this issue
  • I'm willing to provide further clarification or assistance if needed.

Hi @tejasbenibagde we already have similar issue #274, if you would like to collaborate on same ?

@tejasbenibagde there's already an issue on tht