Skip to content

fix: make the lint toolchain work on Windows - #21

Merged
SynthLuvr merged 2 commits into
mainfrom
fix/windows-compatibility
Aug 18, 2026
Merged

SynthLuvr merged 2 commits into
mainfrom
fix/windows-compatibility

Conversation

@SynthLuvr

@SynthLuvr SynthLuvr commented Aug 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to a Windows-compatibility audit: pnpm install, build, and test already work on Windows (every native tool in the lockfile ships win32 binaries), but a fresh Windows clone failed pnpm lint for two reasons. Both are fixed here.

1. spawnSync("pnpm", ...) failed with EINVAL

scripts/peer-deps.mts spawned pnpm without shell. On Windows, pnpm installs as a pnpm.cmd shim (corepack/npm), and since the CVE-2024-27980 fix (Node >= 18.20.2 / 20.12.2) Node refuses to spawn .cmd/.bat files unless shell: true is set — so pnpm lint:peer-deps (and therefore pnpm lint) aborted. The fix enables shell on win32 only; 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 to core.autocrlf=true, so a fresh clone checked out CRLF and the biome format check plus lint:md failed immediately. This adds .gitattributes with * text=auto eol=lf plus a two-line rationale.

Also

  • README: the prerequisite said "Node.js 24" while engines enforces == 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

  • Add a windows-latest job to CI (pandoc via winget) so Windows compatibility stays proven.

- 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.
@SynthLuvr
SynthLuvr merged commit 1ebc8a3 into main Aug 18, 2026
1 check passed
@SynthLuvr
SynthLuvr deleted the fix/windows-compatibility branch August 18, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant