feat: configure Husky and lint-staged for automated pre-commit checks (#111)#142
Merged
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom Mar 29, 2026
Merged
Conversation
|
@JosephOnuh 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! 🚀 |
Contributor
|
Pr under review. |
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.
Summary
Closes #111
Introduces automated pre-commit hooks to the SoroTask monorepo using Husky and lint-staged. Ensures all staged code adheres to ESLint and Prettier configurations before reaching the repository, reducing CI noise and preventing poorly formatted code from entering the main branch.
Key Changes
package.jsonwith"prepare": "husky"script. Git hooks trigger automatically on every local commit afternpm install..lintstagedrc.jsonconfigured to only process staged files — keeps commits fast as the monorepo grows.Files Changed
package.json— root devDependencies (husky,lint-staged) +preparescriptpackage-lock.json— lockfile for root dependencies.lintstagedrc.json— lint-staged rules for JS/TS and config/doc files.husky/pre-commit— hook script runningnpx lint-stagedREADME.md— added "Git Hooks" sectionHow to Verify
npm installfrom the repo root to trigger thepreparescript and install hooks..tsfile (e.g., inconsistent indentation).git add . && git commit -m "test"— hooks should run, auto-fix the file, and complete the commit.git commit -m "test" --no-verify— verify hooks are skipped entirely.Checklist
preparescript added to rootpackage.json.lintstagedrc.jsoncovers all relevant file extensionschmod +x)