File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Expand file tree Collapse file tree 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 = (
6060 resolver ?: ResolverFactory | null ,
6161 // eslint-disable-next-line sonarjs/cognitive-complexity
6262) : ResolvedResult => {
63+ options ||= { }
64+
6365 // don't worry about core node/bun modules
6466 if (
6567 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 ) )
6770 ) {
6871 log ( 'matched core:' , source )
6972
@@ -84,8 +87,6 @@ export const resolve = (
8487
8588 source = removeQuerystring ( source )
8689
87- options ||= { }
88-
8990 if ( ! resolver ) {
9091 const optionsHash = stableHash ( options )
9192 const cwd = process . cwd ( )
Original file line number Diff line number Diff line change @@ -6,5 +6,9 @@ export interface TypeScriptResolverOptions extends NapiResolveOptions {
66 * @default true - whether to always try to resolve `@types` packages
77 */
88 alwaysTryTypes ?: boolean
9+ /**
10+ * Whether `bun` core modules should be accounted
11+ */
12+ bun ?: boolean
913 noWarnOnMultipleProjects ?: boolean
1014}
You can’t perform that action at this time.
0 commit comments