Skip to content

Commit 97ad2f5

Browse files
committed
fix(linter): use pathToFileURL for importing plugins to ensure correct URL format
1 parent d16df93 commit 97ad2f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/oxlint/src-js/plugins/load.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { pathToFileURL } from 'node:url';
2+
13
import { Context } from './context.js';
24
import { getErrorMessage } from './utils.js';
35

@@ -100,7 +102,7 @@ async function loadPluginImpl(path: string): Promise<PluginDetails> {
100102
throw new Error('This plugin has already been registered. This is a bug in Oxlint. Please report it.');
101103
}
102104

103-
const { default: plugin } = (await import(path)) as { default: Plugin };
105+
const { default: plugin } = (await import(pathToFileURL(path).href)) as { default: Plugin };
104106

105107
registeredPluginPaths.add(path);
106108

0 commit comments

Comments
 (0)