Skip to content

ci: add Husky pre-commit hooks for lint and formatting#250

Open
AGWAM001 wants to merge 1 commit into
Invoice-Liquidity-Network:mainfrom
AGWAM001:ci/husky-pre-commit
Open

ci: add Husky pre-commit hooks for lint and formatting#250
AGWAM001 wants to merge 1 commit into
Invoice-Liquidity-Network:mainfrom
AGWAM001:ci/husky-pre-commit

Conversation

@AGWAM001
Copy link
Copy Markdown

@AGWAM001 AGWAM001 commented Jun 2, 2026

Closes #227

Summary

Sets up Husky pre-commit and pre-push hooks with lint-staged to catch lint errors, formatting issues, and type errors locally before they reach CI.


Changes

  • Installed husky and lint-staged as dev dependencies
  • Configured lint-staged to run eslint --fix and prettier --write on staged .ts/.tsx/.js/.jsx files on pre-commit
  • Added a pre-push hook to run tsc --noEmit and catch type errors before push
  • Documented setup and usage in CONTRIBUTING.md

How to test

  1. Pull the branch and run npm install to set up hooks
  2. Stage a file with a lint or formatting issue and run git commit — the hook should auto-fix and block the commit if unfixable errors remain
  3. Run git push on a branch with a TypeScript error — the pre-push hook should fail and prevent the push
  4. Verify a clean commit + push completes in under 10 seconds

Notes

  • Hooks only run on staged files, keeping pre-commit fast for typical changes
  • tsc --noEmit runs project-wide on push, not scoped to staged files, to ensure full type safety
  • New contributors will need to run npm install after cloning to activate the hooks (documented in CONTRIBUTING.md)

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@AGWAM001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Marvell69
Copy link
Copy Markdown
Contributor

Please resolve conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up Husky pre-commit hooks

2 participants