@@ -29,19 +29,24 @@ This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, a
29
29
- [ Configuration (legacy: ` .eslintrc* ` )] ( #configuration-legacy-eslintrc )
30
30
- [ TypeScript] ( #typescript )
31
31
- [ Configuration (new: ` eslint.config.js ` )] ( #configuration-new-eslintconfigjs )
32
+ - [ JS example] ( #js-example )
33
+ - [ Typescript example] ( #typescript-example )
32
34
- [ Resolvers] ( #resolvers )
35
+ - [ ` import-x/resolver-next ` ] ( #import-xresolver-next )
36
+ - [ ` import-x/resolver ` ] ( #import-xresolver )
33
37
- [ Settings] ( #settings )
34
38
- [ ` import-x/extensions ` ] ( #import-xextensions )
35
39
- [ ` import-x/ignore ` ] ( #import-xignore )
36
40
- [ ` import-x/core-modules ` ] ( #import-xcore-modules )
37
41
- [ ` import-x/external-module-folders ` ] ( #import-xexternal-module-folders )
38
42
- [ ` import-x/parsers ` ] ( #import-xparsers )
39
- - [ ` import-x/resolver ` ] ( #import-xresolver )
43
+ - [ ` import-x/resolver ` and ` import-x/resolver-next ` ] ( #import-xresolver-and-import-xresolver-next )
40
44
- [ ` import-x/cache ` ] ( #import-xcache )
41
45
- [ ` import-x/internal-regex ` ] ( #import-xinternal-regex )
42
46
- [ SublimeLinter-eslint] ( #sublimelinter-eslint )
43
- - [ Sponsors] ( #sponsors )
44
- - [ Backers] ( #backers )
47
+ - [ Sponsors and Backers] ( #sponsors-and-backers )
48
+ - [ Sponsors] ( #sponsors )
49
+ - [ Backers] ( #backers )
45
50
- [ Changelog] ( #changelog )
46
51
- [ License] ( #license )
47
52
@@ -193,23 +198,16 @@ settings:
193
198
From [`v8.21.0`](https://github.com/eslint/eslint/releases/tag/v8.21.0), ESLint announced a new config system.
194
199
In the new system, `.eslintrc*` is no longer used. `eslint.config.js` would be the default config file name.
195
200
196
- <details>
197
- <summary>JS example</summary>
201
+ # ## JS example
198
202
199
203
` ` ` js
200
204
import js from '@eslint/js'
201
- import eslintPluginImportX from 'eslint-plugin-import-x'
205
+ import * as pluginImportX from 'eslint-plugin-import-x'
202
206
203
- export default [
204
- js.configs.recommended,
205
- eslintPluginImportX.flatConfigs.recommended,
206
- ]
207
+ export default [js.configs.recommended, pluginImportX.flatConfigs.recommended]
207
208
` ` `
208
209
209
- </details>
210
-
211
- <details>
212
- <summary>Typescript example</summary>
210
+ # ## Typescript example
213
211
214
212
You have to install `eslint-import-resolver-typescript` :
215
213
@@ -219,13 +217,13 @@ npm install eslint-import-resolver-typescript --save-dev
219
217
220
218
` ` ` js
221
219
import js from '@eslint/js'
222
- import eslintPluginImportX from 'eslint-plugin-import-x'
220
+ import * as pluginImportX from 'eslint-plugin-import-x'
223
221
import tsParser from '@typescript-eslint/parser'
224
222
225
223
export default [
226
224
js.configs.recommended,
227
- eslintPluginImportX .flatConfigs.recommended,
228
- eslintPluginImportX .flatConfigs.typescript,
225
+ pluginImportX .flatConfigs.recommended,
226
+ pluginImportX .flatConfigs.typescript,
229
227
{
230
228
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
231
229
ignores: ['eslint.config.js'],
@@ -243,10 +241,6 @@ export default [
243
241
]
244
242
` ` `
245
243
246
- </details>
247
-
248
- ---
249
-
250
244
> [!NOTE]
251
245
> A complete list of available configuration can be found in [config/flat folders](src/config/flat)
252
246
@@ -273,6 +267,32 @@ You can reference resolvers in several ways (in order of precedence):
273
267
274
268
- as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo` :
275
269
270
+ # ## `import-x/resolver-next`
271
+
272
+ > [!warning]
273
+ >
274
+ > Only available in the new flat config system. If you are using the legacy config system, please use `import-x/resolver` instead.
275
+
276
+ ` ` ` js
277
+ // eslint.config.js
278
+
279
+ import { createTypeScriptResolver } from 'eslint-import-resolver-typescript'
280
+ import { createNodeResolver } from 'eslint-plugin-import-x'
281
+
282
+ export default [
283
+ {
284
+ settings: {
285
+ 'import/resolver-next': [
286
+ createTypeScriptResolver(/* Your override options go here */),
287
+ createNodeResolver(/* Your override options go here */),
288
+ ],
289
+ },
290
+ },
291
+ ]
292
+ ` ` `
293
+
294
+ # ## `import-x/resolver`
295
+
276
296
` ` ` yaml
277
297
# .eslintrc.yml
278
298
settings:
@@ -501,7 +521,7 @@ depending on how far down the rabbit hole goes. Submit an issue if you find stra
501
521
behavior beyond here, but steel your heart against the likely outcome of closing
502
522
with `wontfix`.
503
523
504
- # ## `import-x/resolver`
524
+ # ## `import-x/resolver` and `import-x/resolver-next`
505
525
506
526
See [resolvers](#resolvers).
507
527
@@ -617,15 +637,17 @@ In Package Settings / SublimeLinter / User Settings:
617
637
I believe this defaults to `3`, so you may not need to alter it depending on your
618
638
project folder max depth.
619
639
620
- [](https://github.com/sponsors/JounQin)
640
+ # # Sponsors and Backers
641
+
642
+ [](https://github.com/sponsors/JounQin)
621
643
622
- # # Sponsors
644
+ # ## Sponsors
623
645
624
646
| 1stG | RxTS | UnTS |
625
647
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
626
648
| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) |
627
649
628
- # # Backers
650
+ # ## Backers
629
651
630
652
| 1stG | RxTS | UnTS |
631
653
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
0 commit comments