Repository navigation
fix: make the lint toolchain work on Windows - #21
Merged
Merged
Conversation
- peer-deps.mts: spawn pnpm with shell on win32; Node throws EINVAL for .cmd shims without shell since CVE-2024-27980 - add .gitattributes enforcing LF; Git for Windows defaults to core.autocrlf=true, which broke biome's lf lineEnding check and the pandoc byte-for-byte markdown comparison on fresh clones - README: Node.js prerequisite 24 -> 26 (matches engines ==26); add cross-platform note
- .gitattributes: trim the four-line rationale to two lines, keeping the non-obvious autocrlf vs LF-enforcement context - peer-deps.mts: tighten the .cmd shim / CVE-2024-27980 comment No functional change: the eol rule and the spawn flags are untouched.
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
Follow-up to a Windows-compatibility audit:
pnpm install,build, andtestalready work on Windows (every native tool in the lockfile ships win32 binaries), but a fresh Windows clone failedpnpm lintfor two reasons. Both are fixed here.1.
spawnSync("pnpm", ...)failed with EINVALscripts/peer-deps.mtsspawnedpnpmwithoutshell. On Windows, pnpm installs as apnpm.cmdshim (corepack/npm), and since the CVE-2024-27980 fix (Node >= 18.20.2 / 20.12.2) Node refuses to spawn.cmd/.batfiles unlessshell: trueis set — sopnpm lint:peer-deps(and thereforepnpm lint) aborted. The fix enablesshellonwin32only; arguments are static literals, so there is no injection surface. A brief comment at the call site records the CVE rationale.2. CRLF checkouts broke the LF-enforced checks
The toolchain enforces LF (biome
"lineEnding": "lf", byte-for-byte pandoc markdown comparison) but the repo shipped no.gitattributes. Git for Windows defaults tocore.autocrlf=true, so a fresh clone checked out CRLF and the biome format check pluslint:mdfailed immediately. This adds.gitattributeswith* text=auto eol=lfplus a two-line rationale.Also
enginesenforces== 26— corrected, and added a cross-platform note.Validation
pnpm install --frozen-lockfile && pnpm build && pnpm lint && pnpm test— all pass (Linux, pandoc 3.1.3, same pin as CI).Suggested follow-up
windows-latestjob to CI (pandoc viawinget) so Windows compatibility stays proven.