[GH-ISSUE #6] Add pre-commit hooks for linting, formatting, and type checking #3

Closed
opened 2026-10-15 18:19:46 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Jul 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6

Motivation

The project currently relies on manual npm run check and CI for quality enforcement. Adding pre-commit hooks via Husky and lint-staged would catch issues at commit time, providing faster feedback to developers and agents working on the codebase.

Proposed Changes

  1. Add husky and lint-staged as dev dependencies
  2. Configure a pre-commit hook that runs:
    • Prettier formatting on staged files
    • ESLint on staged .ts files
    • TypeScript type checking on the full project
  3. Add a prepare script to automatically install Husky hooks after npm install
  4. Document the pre-commit workflow in CONTRIBUTING.md

Acceptance Criteria

  • Committing un-formatted TypeScript files is blocked until prettier fixes them
  • Committing TypeScript files with lint errors is blocked
  • Committing TypeScript files that break type checking is blocked
  • npm install triggers Husky installation via the prepare script
Originally created by @morluto on GitHub (Jul 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6 ## Motivation The project currently relies on manual `npm run check` and CI for quality enforcement. Adding pre-commit hooks via Husky and lint-staged would catch issues at commit time, providing faster feedback to developers and agents working on the codebase. ## Proposed Changes 1. Add `husky` and `lint-staged` as dev dependencies 2. Configure a pre-commit hook that runs: - Prettier formatting on staged files - ESLint on staged `.ts` files - TypeScript type checking on the full project 3. Add a `prepare` script to automatically install Husky hooks after `npm install` 4. Document the pre-commit workflow in CONTRIBUTING.md ## Acceptance Criteria - [ ] Committing un-formatted TypeScript files is blocked until `prettier` fixes them - [ ] Committing TypeScript files with lint errors is blocked - [ ] Committing TypeScript files that break type checking is blocked - [ ] `npm install` triggers Husky installation via the `prepare` script
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3
No description provided.