Skip to content

Set up Husky pre-commit hooks #227

Description

@Marvell69

Without pre-commit checks, lint errors and formatting issues are caught only in CI, slowing down the review cycle. Husky pre-commit hooks catch the most common issues locally before they're ever pushed.

Requirements and context

  • Install husky and lint-staged
  • Pre-commit: run eslint --fix and prettier --write on staged files
  • Pre-push: run tsc --noEmit to catch type errors before push
  • Document in CONTRIBUTING.md
  • Hooks must complete in < 10 seconds for a typical staged change

Suggested execution

git checkout -b ci/husky-pre-commit
  • Install Husky and lint-staged
  • Configure lint-staged for ESLint + Prettier
  • Add pre-push TypeScript check
  • Document in CONTRIBUTING.md

Example commit message
ci: add Husky pre-commit hooks for lint and formatting

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions