chore: fix lint-staged knip workspace path on Windows#20
Closed
reubenyap wants to merge 1 commit intorosen-bridge:devfrom
Closed
chore: fix lint-staged knip workspace path on Windows#20reubenyap wants to merge 1 commit intorosen-bridge:devfrom
reubenyap wants to merge 1 commit intorosen-bridge:devfrom
Conversation
`path.posix.relative` cannot produce a correct relative path from two Windows-absolute paths, so `getKnipCommand` was emitting garbage like `knip --dependencies --workspace ../E:\Github\rosen-ui\packages\X`, which knip rejects as "Workspace is not a directory". This blocked pre-commit hooks on Windows for any commit touching package sources. Use the cross-platform `path.relative` and normalize separators to forward slashes (matching the existing type-check line that already uses `path.relative`).
|
@reubenyap is attempting to deploy a commit to the rosen-bridge Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Apr 22, 2026
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
getKnipCommandin.lintstagedrc.mjscallspath.posix.relative(process.cwd(), dir), but on Windowsprocess.cwd()is a Windows-absolute path (e.g.C:\\path\\to\\repo).path.posix.relativetreats its inputs as POSIX paths, so the mix produces a mangled relative that knip can't resolve to a workspace.Use
path.relative(...)(platform-aware) and then convert separators to/so knip gets a proper POSIX-style workspace path on every OS.Split out of #19 per review — this is a Windows-only dev-tooling fix and has nothing to do with the Firo Bridge Expansion Kit.
Test plan
lint-stagedruns cleanly on macOS / Linux (no behavior change:path.relativeandpath.posix.relativereturn the same string on POSIX).npm run lint-stagedresolves the knip--workspaceargument correctly for a package underpackages/orapps/.