Skip to content

Fix oxlint plugin test on Windows - #221

Open
snowyukitty wants to merge 1 commit into
cloudflare:mainfrom
snowyukitty:fix/windows-oxlint-plugin-test
Open

Fix oxlint plugin test on Windows#221
snowyukitty wants to merge 1 commit into
cloudflare:mainfrom
snowyukitty:fix/windows-oxlint-plugin-test

Conversation

@snowyukitty

Copy link
Copy Markdown

What does this change?

Fixes #220.

Convert the absolute path returned by require.resolve() to a file: 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 to import() 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:

AI tools assisted the investigation, patch drafting, and review. The failure and verification results above were reproduced locally.

Checklist

  • This is a small, concrete change; it is not a feature, refactor, or low-value cleanup.
  • I understand that maintainers decide whether the change is obviously correct and trivially verifiable.
  • I have read and followed the contribution guidelines.

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.

Oxlint plugin test fails on Windows before running

1 participant