Skip to content

Commit 8180f01

Browse files
authored
fix: add node: prefix to build-in modules (#579)
1 parent 4a2724d commit 8180f01

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/module/src/modules/config/generate.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ export async function generateESLintConfig(
7373
const imports = await Promise.all(importLines.map(async (line): Promise<Import> => {
7474
return {
7575
...line,
76-
from: (line.from.match(/^\w+:/) || builtinModules.includes(line.from))
77-
? line.from
78-
: relativeWithDot(await r.resolvePath(line.from)),
76+
from: builtinModules.includes(line.from)
77+
? line.from.replace(/^(node:)?/, 'node:')
78+
: line.from.match(/^\w+:/)
79+
? line.from
80+
: relativeWithDot(await r.resolvePath(line.from)),
7981
}
8082
}))
8183

0 commit comments

Comments
 (0)