@@ -30,6 +30,8 @@ This means you can:
30
30
- [ Configuration] ( #configuration )
31
31
- [ ` eslint.config.js ` ] ( #eslintconfigjs )
32
32
- [ ` .eslintrc ` ] ( #eslintrc )
33
+ - [ Other environments] ( #other-environments )
34
+ - [ Bun] ( #bun )
33
35
- [ Options from ` rspack-resolver ` ] ( #options-from-rspack-resolver )
34
36
- [ ` conditionNames ` ] ( #conditionnames )
35
37
- [ ` extensions ` ] ( #extensions )
@@ -94,6 +96,8 @@ export default [
94
96
createTypeScriptImportResolver ({
95
97
alwaysTryTypes: true , // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
96
98
99
+ bun: true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
100
+
97
101
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
98
102
99
103
// use <root>/path/to/folder/tsconfig.json
@@ -136,6 +140,8 @@ export default [
136
140
typescript: {
137
141
alwaysTryTypes: true , // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
138
142
143
+ bun: true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
144
+
139
145
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
140
146
141
147
// use <root>/path/to/folder/tsconfig.json
@@ -186,6 +192,8 @@ Add the following to your `.eslintrc` config:
186
192
" typescript" : {
187
193
" alwaysTryTypes" : true , // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
188
194
195
+ " bun" : true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
196
+
189
197
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
190
198
191
199
// use <root>/path/to/folder/tsconfig.json
@@ -216,6 +224,18 @@ Add the following to your `.eslintrc` config:
216
224
}
217
225
```
218
226
227
+ ### Other environments
228
+
229
+ #### Bun
230
+
231
+ [ Bun] ( https://bun.sh/ ) provides built-in modules such as ` bun:test ` , which are not resolved by default.
232
+
233
+ Enable Bun built-in module resolution by choosing 1 out of these 3 options:
234
+
235
+ - Set the ` bun: true ` option, as shown in [ Configuration] ( #configuration ) above
236
+ - Run ESLint with ` bun --bun eslint `
237
+ - [ Configure ` run.bun ` in ` bunfig.toml ` ] ( https://bun.sh/docs/runtime/bunfig#run-bun-auto-alias-node-to-bun )
238
+
219
239
## Options from [ ` rspack-resolver ` ] [ ]
220
240
221
241
### ` conditionNames `
0 commit comments