Skip to content

Commit 43fc638

Browse files
authored
prefer-node-protocol: Fix false positive on bun:* modules (#2272)
1 parent 8a2e7db commit 43fc638

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

rules/prefer-node-protocol.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const create = () => ({
3333
typeof value !== 'string'
3434
|| value.startsWith('node:')
3535
|| !isBuiltinModule(value)
36+
|| !isBuiltinModule(`node:${value}`)
3637
) {
3738
return;
3839
}

test/prefer-node-protocol.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ test.snapshot({
2525
}
2626
`,
2727
'import "punycode/";',
28+
// https://bun.sh/docs/runtime/bun-apis
29+
'import "bun";',
30+
'import "bun:jsc";',
31+
'import "bun:sqlite";',
2832
],
2933
invalid: [
3034
'import fs from "fs";',

0 commit comments

Comments
 (0)