feat: add lightweight staged-file pre-commit gates#59
Merged
Sparkier merged 1 commit intoJul 18, 2026
Merged
Conversation
Sparkier
deleted the
jules/setup-pre-commit-gates-js1-6c0b599d-d670-4220-832c-f151a46e7d27
branch
July 18, 2026 09:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context & Rationale
Currently, developers can push poorly formatted or style-violating code to remote branches. This shifts the burden of formatting and basic lint checks entirely onto the late-stage CI pipeline, resulting in slower feedback loops and wasted CI resources.
To solve this, we are introducing a lightweight, local pre-commit gate system. By shifting these checks "left" into the local development workflow, we validate compliance before the code ever leaves the developer's machine.
Key Decisions
lint-staged. This ensures only newly modified files are validated.bun.Proposed Changes
Dependency Additions
huskyandlint-stagedas development dependencies to orchestrate the Git hook lifecycle.Husky Hook Configuration
"prepare": "husky"script inpackage.jsonso that Git hooks are automatically registered on developers' local machines upon runningbun install..husky/pre-commithook that triggersbun x lint-stagedwhenever a commit is initiated.Staged Validation Configuration
lint-stagedwithinpackage.jsonto handle staged files:prettier --write): Automatically reformats and re-stages files with minor stylistic issues without halting the commit.eslint): Scans for code quality violations. If errors are found, the commit is aborted, and the offending lines are outputted directly to the terminal for local remediation.Verification & Testing
git commit --no-verify.