Skip to content

fix(windows): resolve browser script paths from file URLs#96

Open
Gujiassh wants to merge 1 commit intopbakaus:mainfrom
Gujiassh:fix/windows-browser-script-path
Open

fix(windows): resolve browser script paths from file URLs#96
Gujiassh wants to merge 1 commit intopbakaus:mainfrom
Gujiassh:fix/windows-browser-script-path

Conversation

@Gujiassh
Copy link
Copy Markdown
Contributor

Summary

  • replace new URL(import.meta.url).pathname with a fileURLToPath-based helper when resolving detect-antipatterns-browser.js
  • reuse the same helper for both URL scanning and live server injection paths
  • add a Windows path regression test so drive letters do not get doubled

Testing

  • node - <<'NODE' ... browserScriptPathFromModulePath(..., path.win32) ... NODE
  • bun test tests/detect-antipatterns.test.js
    • the new Windows path regression passes
    • the suite still has the pre-existing linked stylesheet detected (jsdom default) failure unrelated to this change

Fixes #95

@Gujiassh Gujiassh requested a review from pbakaus as a code owner April 11, 2026 12:27
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.

Windows: detect command fails with doubled drive letter in path

1 participant