Fix oxlint plugin test on Windows - #221
Open
snowyukitty wants to merge 1 commit into
Open
Conversation
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.
What does this change?
Fixes #220.
Convert the absolute path returned by
require.resolve()to afile:URL before dynamically importing Vite+'s pinned oxlint plugin test helper. This lets the test file start on Windows, where a raw drive-letter path is not a valid ESM specifier.Why is this obviously correct and trivially verifiable?
pathToFileURL()is Node's standard conversion from a filesystem path to an importable file URL. The resolved module and all test behavior remain unchanged; only the representation passed toimport()changes. The patch adds one standard-library import and wraps the existing resolved path.Verification on Windows with Node 22.22.3 and pnpm 11.17.0:
node --test scripts/oxlint-plugin.test.js— 32 passedpnpm lint:check— passed (existing warnings only)pnpm lint— lint passed, but the recursive type/build phase hit the existingspawnSync pnpm ENOENTfailure in unchangedpackages/gatekeeper-scheduler/build-app.mjstracked by pnpm run-local cannot start on Windows: spawnSync pnpm ENOENT #19 and fix: invoke pnpm via npm_execpath on Windows (fixes #19) #107AI tools assisted the investigation, patch drafting, and review. The failure and verification results above were reproduced locally.
Checklist