Skip to content

Add pre-commit hooks with husky and lint-staged #221

Description

@robertocarlous

Summary

There are no pre-commit hooks, so unformatted or lint-failing code can be committed. This creates noisy diffs and lets type errors slip into PRs.

Proposed Setup

// package.json additions
"lint-staged": {
  "src/**/*.ts": ["eslint --fix", "prettier --write"],
  "tests/**/*.ts": ["eslint --fix", "prettier --write"]
}
  • Install husky and lint-staged
  • husky install wired to prepare npm script
  • Pre-commit hook runs lint-staged
  • Pre-push hook runs npm run test -- --passWithNoTests

Acceptance Criteria

  • npm install sets up hooks automatically via prepare script
  • Committing a file with a lint error is blocked
  • Committing a file with wrong formatting auto-fixes and re-stages
  • CI still runs full lint + tests independently of hooks

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type
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