Problem Statement
Contributors sometimes commit code with TypeScript errors or bad formatting, which fails CI and clutters the commit history.
Proposed Solution
Install Husky and lint-staged. Configure a pre-commit hook that runs eslint --fix and prettier --write on staged files, and runs tsc --noEmit to catch type errors before the commit succeeds.
Alternatives Considered
Only relying on CI, but failing fast locally provides better developer experience.
Additional Context
Keep the hook fast. Only lint staged files, not the whole codebase.
Problem Statement
Contributors sometimes commit code with TypeScript errors or bad formatting, which fails CI and clutters the commit history.
Proposed Solution
Install Husky and lint-staged. Configure a pre-commit hook that runs
eslint --fixandprettier --writeon staged files, and runstsc --noEmitto catch type errors before the commit succeeds.Alternatives Considered
Only relying on CI, but failing fast locally provides better developer experience.
Additional Context
Keep the hook fast. Only lint staged files, not the whole codebase.