Skip to content

Add pre-commit hooks (ESLint via Husky + lint-staged)#88

Open
meninoebom wants to merge 1 commit into
mainfrom
chore/pre-commit-hooks
Open

Add pre-commit hooks (ESLint via Husky + lint-staged)#88
meninoebom wants to merge 1 commit into
mainfrom
chore/pre-commit-hooks

Conversation

@meninoebom
Copy link
Copy Markdown
Owner

Summary

  • Adds Husky for Git hook management and lint-staged to run linters on staged files only
  • Pre-commit hook runs eslint --fix on staged *.{ts,tsx,js,jsx} files
  • Catches lint issues before they reach the repo and auto-fixes what it can

Why

Enforces consistent code quality without relying on developers remembering to run lint manually. Keeps it minimal — ESLint only, no type-checking or tests in the hook to keep commits fast.

Test plan

  • Stage a .ts file with a lint violation and verify the hook catches it
  • Verify auto-fixable issues get fixed on commit
  • Verify clean files commit without issues

🤖 Generated with Claude Code

Runs ESLint --fix on staged .ts/.tsx/.js/.jsx files before each commit
to catch lint issues early and auto-fix what it can.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying lineage with  Cloudflare Pages  Cloudflare Pages

Latest commit: d282685
Status: ✅  Deploy successful!
Preview URL: https://8e3fbdf4.lineage-5ub.pages.dev
Branch Preview URL: https://chore-pre-commit-hooks.lineage-5ub.pages.dev

View logs

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.

1 participant