Summary
On Windows, the oxlint plugin test exits before any RuleTester cases run because its dynamic import() receives an absolute filesystem path.
Reproduction
- Install dependencies with pnpm.
- Run
node --test scripts/oxlint-plugin.test.js on Windows.
The process fails with:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
I reproduced this with Node 22.22.3 and pnpm 11.17.0.
Cause
vitePlusRequire.resolve("oxlint/plugins-dev") returns an absolute filesystem path. On Windows, passing that path directly to import() makes the drive letter look like a URL scheme.
Converting the resolved path with Node's pathToFileURL() before importing allows all 32 existing test cases to run and pass, while remaining valid on POSIX platforms.
AI tools assisted the investigation and drafting. The failure and passing test result above were verified in the stated Windows environment.
Summary
On Windows, the oxlint plugin test exits before any
RuleTestercases run because its dynamicimport()receives an absolute filesystem path.Reproduction
node --test scripts/oxlint-plugin.test.json Windows.The process fails with:
I reproduced this with Node 22.22.3 and pnpm 11.17.0.
Cause
vitePlusRequire.resolve("oxlint/plugins-dev")returns an absolute filesystem path. On Windows, passing that path directly toimport()makes the drive letter look like a URL scheme.Converting the resolved path with Node's
pathToFileURL()before importing allows all 32 existing test cases to run and pass, while remaining valid on POSIX platforms.AI tools assisted the investigation and drafting. The failure and passing test result above were verified in the stated Windows environment.