@@ -25,14 +25,14 @@ This means you can:
25
25
26
26
- [ Notice] ( #notice )
27
27
- [ Installation] ( #installation )
28
- - [ ` eslint-plugin-import ` ] ( #eslint-plugin-import )
29
28
- [ ` eslint-plugin-import-x ` ] ( #eslint-plugin-import-x )
29
+ - [ ` eslint-plugin-import ` ] ( #eslint-plugin-import )
30
30
- [ Configuration] ( #configuration )
31
31
- [ ` eslint.config.js ` ] ( #eslintconfigjs )
32
32
- [ ` .eslintrc ` ] ( #eslintrc )
33
33
- [ Other environments] ( #other-environments )
34
34
- [ Bun] ( #bun )
35
- - [ Options from ` rspack -resolver` ] ( #options-from-rspack -resolver )
35
+ - [ Options from ` unrs -resolver` ] ( #options-from-unrs -resolver )
36
36
- [ ` conditionNames ` ] ( #conditionnames )
37
37
- [ ` extensions ` ] ( #extensions )
38
38
- [ ` extensionAlias ` ] ( #extensionalias )
@@ -53,30 +53,30 @@ If you're facing some problems on rules `import/default` or `import/named` from
53
53
54
54
## Installation
55
55
56
- ### ` eslint-plugin-import `
56
+ ### ` eslint-plugin-import-x `
57
57
58
58
``` sh
59
59
# npm
60
- npm i -D eslint-plugin-import eslint-import-resolver-typescript
60
+ npm i -D eslint-plugin-import-x eslint-import-resolver-typescript
61
61
62
62
# pnpm
63
- pnpm i -D eslint-plugin-import eslint-import-resolver-typescript
63
+ pnpm i -D eslint-plugin-import-x eslint-import-resolver-typescript
64
64
65
65
# yarn
66
- yarn add -D eslint-plugin-import eslint-import-resolver-typescript
66
+ yarn add -D eslint-plugin-import-x eslint-import-resolver-typescript
67
67
```
68
68
69
- ### ` eslint-plugin-import-x `
69
+ ### ` eslint-plugin-import `
70
70
71
71
``` sh
72
72
# npm
73
- npm i -D eslint-plugin-import-x eslint-import-resolver-typescript
73
+ npm i -D eslint-plugin-import eslint-import-resolver-typescript
74
74
75
75
# pnpm
76
- pnpm i -D eslint-plugin-import-x eslint-import-resolver-typescript
76
+ pnpm i -D eslint-plugin-import eslint-import-resolver-typescript
77
77
78
78
# yarn
79
- yarn add -D eslint-plugin-import-x eslint-import-resolver-typescript
79
+ yarn add -D eslint-plugin-import eslint-import-resolver-typescript
80
80
```
81
81
82
82
## Configuration
@@ -98,30 +98,27 @@ export default [
98
98
99
99
bun: true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
100
100
101
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
101
+ // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json or <root>/jsconfig.json by default
102
102
103
- // use <root>/path/to/folder/tsconfig.json
103
+ // use <root>/path/to/folder/tsconfig.json or <root>/path/to/folder/jsconfig.json
104
104
project: ' path/to/folder' ,
105
105
106
- // Multiple tsconfigs (Useful for monorepos)
106
+ // Multiple tsconfigs/jsconfigs (Useful for monorepos, but discouraged in favor of `references` supported )
107
107
108
108
// use a glob pattern
109
- project: ' packages/*/tsconfig .json' ,
109
+ project: ' packages/*/{ts,js}config .json' ,
110
110
111
111
// use an array
112
112
project: [
113
113
' packages/module-a/tsconfig.json' ,
114
- ' packages/module-b/tsconfig .json' ,
114
+ ' packages/module-b/jsconfig .json' ,
115
115
],
116
116
117
117
// use an array of glob patterns
118
118
project: [
119
119
' packages/*/tsconfig.json' ,
120
- ' other-packages/*/tsconfig .json' ,
120
+ ' other-packages/*/jsconfig .json' ,
121
121
],
122
-
123
- // use <root>/jsconfig.json
124
- project: ' jsconfig.json' ,
125
122
}),
126
123
],
127
124
},
@@ -142,30 +139,27 @@ export default [
142
139
143
140
bun: true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
144
141
145
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
142
+ // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json or <root>/jsconfig.json by default
146
143
147
- // use <root>/path/to/folder/tsconfig.json
144
+ // use <root>/path/to/folder/tsconfig.json or <root>/path/to/folder/jsconfig.json
148
145
project: ' path/to/folder' ,
149
146
150
- // Multiple tsconfigs (Useful for monorepos)
147
+ // Multiple tsconfigs/jsconfigs (Useful for monorepos, but discouraged in favor of `references` supported )
151
148
152
149
// use a glob pattern
153
- project: ' packages/*/tsconfig .json' ,
150
+ project: ' packages/*/{ts,js}config .json' ,
154
151
155
152
// use an array
156
153
project: [
157
154
' packages/module-a/tsconfig.json' ,
158
- ' packages/module-b/tsconfig .json' ,
155
+ ' packages/module-b/jsconfig .json' ,
159
156
],
160
157
161
158
// use an array of glob patterns
162
159
project: [
163
160
' packages/*/tsconfig.json' ,
164
- ' other-packages/*/tsconfig .json' ,
161
+ ' other-packages/*/jsconfig .json' ,
165
162
],
166
-
167
- // use <root>/jsconfig.json
168
- project: ' jsconfig.json' ,
169
163
},
170
164
},
171
165
},
@@ -194,30 +188,27 @@ Add the following to your `.eslintrc` config:
194
188
195
189
" bun" : true , // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun
196
190
197
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
191
+ // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json or <root>/jsconfig.json by default
198
192
199
- // use <root>/path/to/folder/tsconfig.json
193
+ // use <root>/path/to/folder/tsconfig.json or <root>/path/to/folder/jsconfig.json
200
194
" project" : " path/to/folder" ,
201
195
202
- // Multiple tsconfigs (Useful for monorepos)
196
+ // Multiple tsconfigs (Useful for monorepos, but discouraged in favor of `references` supported )
203
197
204
198
// use a glob pattern
205
- " project" : " packages/*/tsconfig .json" ,
199
+ " project" : " packages/*/{ts,js}config .json" ,
206
200
207
201
// use an array
208
202
" project" : [
209
203
" packages/module-a/tsconfig.json" ,
210
- " packages/module-b/tsconfig .json" ,
204
+ " packages/module-b/jsconfig .json" ,
211
205
],
212
206
213
207
// use an array of glob patterns
214
208
" project" : [
215
209
" packages/*/tsconfig.json" ,
216
- " other-packages/*/tsconfig .json" ,
210
+ " other-packages/*/jsconfig .json" ,
217
211
],
218
-
219
- // use <root>/jsconfig.json
220
- " project" : " jsconfig.json" ,
221
212
},
222
213
},
223
214
},
@@ -236,7 +227,7 @@ Enable Bun built-in module resolution by choosing 1 out of these 3 options:
236
227
- Run ESLint with ` bun --bun eslint `
237
228
- [ Configure ` run.bun ` in ` bunfig.toml ` ] ( https://bun.sh/docs/runtime/bunfig#run-bun-auto-alias-node-to-bun )
238
229
239
- ## Options from [ ` rspack -resolver` ] [ ]
230
+ ## Options from [ ` unrs -resolver` ] [ ]
240
231
241
232
### ` conditionNames `
242
233
@@ -320,7 +311,7 @@ Default:
320
311
321
312
### Other options
322
313
323
- You can pass through other options of [ ` rspack -resolver` ] [ ] directly
314
+ You can pass through other options of [ ` unrs -resolver` ] [ ] directly
324
315
325
316
### Default options
326
317
@@ -361,6 +352,6 @@ Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.m
361
352
362
353
[ `eslint-plugin-import` ] : https://github.com/import-js/eslint-plugin-import
363
354
[ `eslint-plugin-import-x` ] : https://github.com/un-ts/eslint-plugin-import-x
364
- [ `rspack -resolver` ] : https://github.com/unrs/rspack -resolver
355
+ [ `unrs -resolver` ] : https://github.com/unrs/unrs -resolver
365
356
[ `typescript` ] : https://www.typescriptlang.org
366
357
[ isc ] : https://opensource.org/licenses/ISC
0 commit comments