Skip to content

Add pre-commit hooks for ESLint & Prettier using Husky + lint-staged #424

@revaarathore11

Description

@revaarathore11

Feature Description

Add pre-commit hooks to automatically run ESLint and Prettier on staged files before commits using Husky and lint-staged.

This ensures code quality and consistent formatting by catching issues early in the development workflow.

Motivation

Currently, linting and formatting checks rely on developers running ESLint and Prettier manually. This can lead to inconsistent formatting or lint issues being committed unintentionally.

Adding automated pre-commit checks would improve code quality and developer experience by catching issues early.

Expected Behavior

  • ESLint should run with auto-fix on staged .ts files under
  • Prettier should format staged source files, JSON, Markdown, and YAML
  • The checks should run automatically on git commit
  • Commits should be blocked if unfixable lint errors are found
  • No impact on runtime, build, or production behavior

Additional Information
This can be implemented using Husky and lint-staged with the modern (v9+) Husky setup.
The checks should only run on staged files to keep commits fast.

This would be a developer-only tooling improvement.

Metadata

Metadata

Labels

status: newHas not been triaged by admin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions