Prevents pnpm from resolving Prettier from the parent workspace when the hook CWD is the monorepo parent. Co-authored-by: Cursor <cursoragent@cursor.com>
9 lines
323 B
Bash
Executable File
9 lines
323 B
Bash
Executable File
#!/usr/bin/env sh
|
|
. "$(dirname -- "$0")/_/husky.sh"
|
|
|
|
# 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
|