File tree 4 files changed +17
-8
lines changed
4 files changed +17
-8
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ---
2
+ " eslint-import-resolver-typescript " : minor
3
+ ---
4
+
5
+ feat: add a new ` bun?: boolean ` option for ` bun ` users - close #386
6
+
7
+ ` process.versions.bun ` is unavailable even with ` bun eslint ` due to its own design,
8
+ but checking ` bun ` modules for non-bun users is incorrect behavior and just wasting time,
9
+ so a new option is added for such case, you can still run with ` bun --bun eslint ` without this option enabled
Original file line number Diff line number Diff line change @@ -60,10 +60,13 @@ export const resolve = (
60
60
resolver ?: ResolverFactory | null ,
61
61
// eslint-disable-next-line sonarjs/cognitive-complexity
62
62
) : ResolvedResult => {
63
+ options ||= { }
64
+
63
65
// don't worry about core node/bun modules
64
66
if (
65
67
module . isBuiltin ( source ) ||
66
- isBunModule ( source , process . versions . bun as Version )
68
+ ( ( process . versions . bun || options . bun ) &&
69
+ isBunModule ( source , ( process . versions . bun ?? 'latest' ) as Version ) )
67
70
) {
68
71
log ( 'matched core:' , source )
69
72
@@ -84,8 +87,6 @@ export const resolve = (
84
87
85
88
source = removeQuerystring ( source )
86
89
87
- options ||= { }
88
-
89
90
if ( ! resolver ) {
90
91
const optionsHash = stableHash ( options )
91
92
const cwd = process . cwd ( )
Original file line number Diff line number Diff line change @@ -6,5 +6,9 @@ export interface TypeScriptResolverOptions extends NapiResolveOptions {
6
6
* @default true - whether to always try to resolve `@types` packages
7
7
*/
8
8
alwaysTryTypes ?: boolean
9
+ /**
10
+ * Whether `bun` core modules should be accounted
11
+ */
12
+ bun ?: boolean
9
13
noWarnOnMultipleProjects ?: boolean
10
14
}
You can’t perform that action at this time.
0 commit comments