Skip to content

Commit 1b97d8a

Browse files
authored
fix: should prefer module.isBuiltin when process.versions.bun available (#389)
1 parent 79a453b commit 1b97d8a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/light-kangaroos-kiss.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-import-resolver-typescript": patch
3+
---
4+
5+
fix: should prefer `module.isBuiltin` when `process.versions.bun` available

src/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ export const resolve = (
6666

6767
// don't worry about bun core modules
6868
if (bunVersion || options.bun) {
69-
bunVersion ??= 'latest'
7069
if (
71-
isBunModule(source, bunVersion) ||
72-
isSupportedNodeModule(source, bunVersion)
70+
bunVersion
71+
? module.isBuiltin(source)
72+
: isBunModule(source, (bunVersion = 'latest')) ||
73+
isSupportedNodeModule(source, bunVersion)
7374
) {
7475
log('matched bun core:', source)
7576
return { found: true, path: null }

0 commit comments

Comments
 (0)