Skip to content

fix(scripts): run lint and format tools through Node so they work on Windows - #1130

Merged
EhabY merged 1 commit into
mainfrom
fix/windows-lint-scripts
Sep 29, 2026
Merged

EhabY merged 1 commit into
mainfrom
fix/windows-lint-scripts

Conversation

@EhabY

@EhabY EhabY commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

pnpm lint, pnpm format and pnpm format:check fail on Windows with no output. The scripts spawned the node_modules/.bin shims directly. On Windows those are .cmd files that only a shell can run, so the spawn failed and the scripts exited 1 without printing anything.

  • scripts/run-tool.mjs replaces run-oxc.mjs and timed.mjs. It finds the tool's bin script in its package.json and runs it with the current Node binary.
  • It keeps the Oxc thread cap. It now prints a dimmed ⏱ <tool> finished in <time> line for every tool, not only ESLint, in ms under a second and in seconds otherwise.
  • If the tool can't be spawned, the script now throws instead of exiting quietly.
  • The thread-cap comment no longer claims a ~32-thread threshold or links oxc#21672, which is about the missing cache. On a 24-core machine, 8 threads beat the default: oxlint 2.30s to 2.18s, oxfmt 353ms to 268ms.

shell: true would have been the one-line fix. I didn't use it because Node 24 prints a DEP0190 deprecation warning for it, and it passes arguments to the shell unescaped.

Checked on Windows in PowerShell and Git Bash: lint and format pass, and a file with a lint error and bad formatting makes both fail with their usual output.

…Windows

The format and lint scripts spawned the node_modules/.bin shims directly. On Windows those are .cmd files that need a shell, so the spawn failed and the scripts exited 1 without any output.

Replace run-oxc.mjs and timed.mjs with a single run-tool.mjs. It runs the package's bin script with the current Node binary, keeps the Oxc thread cap, and throws spawn errors instead of hiding them. It prints a dimmed "⏱ <tool> finished in <time>" line for every tool, in ms under a second and in seconds otherwise.

The thread cap comment no longer claims a ~32-thread threshold or links oxc#21672, which is about the missing cache. On a 24-core machine the cap of 8 still helps.
@EhabY
EhabY force-pushed the fix/windows-lint-scripts branch from eb7a849 to 528b9f3 Compare September 29, 2026 16:52
@EhabY
EhabY merged commit 7ff5019 into main Sep 29, 2026
14 checks passed
@EhabY
EhabY deleted the fix/windows-lint-scripts branch September 29, 2026 17:36
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.

2 participants