Skip to content

Integrate ESLint, Prettier, and pre-commit hooks for consistent code style #61

@bibekjoshi01

Description

@bibekjoshi01

🔧 The CI/CD or Tooling Change

Background

Currently, the project does not enforce a linting or formatting standard. This can lead to inconsistent code style and minor errors across contributions. Introducing ESLint, Prettier, and pre-commit hooks would help maintain code quality automatically.

Proposal

  1. ESLint

    • Add ESLint configuration with recommended rules for React/Next.js.
    • Enable rules for common best practices and code safety.
  2. Prettier

    • Integrate Prettier for consistent formatting.
    • Ensure ESLint and Prettier rules don’t conflict.
  3. Pre-commit Hooks

    • Use husky and lint-staged to run ESLint + Prettier automatically before each commit.
    • Optionally, add a pre-push hook to prevent commits that fail linting.
  4. CI Integration

    • Add lint checks in GitHub Actions to enforce code style in PRs.

Benefits

  • Enforces consistent code style across contributors.
  • Catches common JS/React errors early.
  • Reduces manual formatting and improves readability.
  • Ensures high-quality code before commits and pushes.

Notes

This can be done incrementally and non-intrusively. I can prepare a PR for this setup if the maintainers approve.

Category

Enhancement / Code Quality

Motivation

Currently, the project does not enforce a consistent code style or linting rules. This can lead to:

  • Inconsistent formatting across contributors.
  • Hard-to-read or buggy code.
  • Increased review comments for minor style issues.

Integrating ESLint, Prettier, and pre-commit hooks will automate code quality checks, ensure a consistent style, and improve overall maintainability. This benefits both the contributors and the maintainers by reducing friction and preventing errors before code is committed.

Impact on Contributors

Contributors will need to install dependencies locally (ESLint, Prettier, husky, lint-staged).

Tooling Focus Areas

  • Build performance
  • Code quality automation
  • Deployment automation
  • Developer experience
  • CI/CD reliability
  • Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions