From c921c4211a8f389cd83048cd11ccf886364fd83e Mon Sep 17 00:00:00 2001 From: defiQUG Date: Mon, 11 May 2026 21:09:58 -0700 Subject: [PATCH] fix(husky): cd to repo root before lint-staged (nested under proxmox) Prevents pnpm from resolving Prettier from the parent workspace when the hook CWD is the monorepo parent. Co-authored-by: Cursor --- .husky/pre-commit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index a5a29d9..1e3d063 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,8 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm lint-staged +# When this repo lives under another tree (e.g. proxmox/the-order), hooks can run with a CWD +# that is not the monorepo root — pnpm then resolves Prettier from the wrong workspace. +ROOT="$(cd "$(dirname -- "$0")/.." && pwd)" +cd "$ROOT" || exit 1 +exec pnpm lint-staged