Skip to content

Commit

Permalink
prefer-node-protocol: Fix false positive on bun:* modules (#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Feb 6, 2024
1 parent 8a2e7db commit 43fc638
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions rules/prefer-node-protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const create = () => ({
typeof value !== 'string'
|| value.startsWith('node:')
|| !isBuiltinModule(value)
|| !isBuiltinModule(`node:${value}`)
) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions test/prefer-node-protocol.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ test.snapshot({
}
`,
'import "punycode/";',
// https://bun.sh/docs/runtime/bun-apis
'import "bun";',
'import "bun:jsc";',
'import "bun:sqlite";',
],
invalid: [
'import fs from "fs";',
Expand Down

0 comments on commit 43fc638

Please sign in to comment.