Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR aims to enforce Prettier formatting on staged files at commit time by adding a Husky pre-commit hook wired to lint-staged (OPS-4067).
Changes:
- Bump
huskyfrom8.0.3to9.1.7. - Add a
lint-stagedconfiguration to runprettier --writeon common file types. - Add a
.husky/pre-commithook that runsnpx lint-staged --verbose.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Updates Husky dependency version. |
| package-lock.json | Locks Husky v9 resolution/metadata (node engine, bin path). |
| .lintstagedrc.json | Adds Prettier formatting command for staged files. |
| .husky/pre-commit | Adds pre-commit hook to run lint-staged. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,4 @@ | |||
| #!/usr/bin/env sh | |||
| . "$(dirname -- "$0")/_/husky.sh" | |||
There was a problem hiding this comment.
The hook sources .husky/_/husky.sh, but this PR doesn’t add the .husky/_ directory (it’s not present in the repo). As-is, the hook will fail with “No such file” and the commit will be blocked. Add the Husky support files under .husky/_ (e.g., husky.sh and its companion files) or update the hook to match the Husky v9-generated template used in this repo.
| . "$(dirname -- "$0")/_/husky.sh" |
| "eslint-plugin-vitest": "0.5.4", | ||
| "generate-license-file": "4.1.0", | ||
| "husky": "8.0.3", | ||
| "husky": "9.1.7", |
There was a problem hiding this comment.
Bumping to Husky v9 won’t actually enable the hook unless Husky is installed to Git’s hooksPath (usually via husky/husky install during install). This repo’s prepare script currently only copies .env, so developers/CI won’t get hooks automatically. Update prepare (or add an appropriate lifecycle script) to run Husky installation in addition to the existing .env setup.



Fixes OPS-4067