@@ -5,7 +5,8 @@ import markdown from "@eslint/markdown";
55import tseslint from "typescript-eslint" ;
66import prettierConfig from "eslint-config-prettier" ;
77import prettierPlugin from "eslint-plugin-prettier" ;
8- import importPlugin from "eslint-plugin-import" ;
8+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript" ;
9+ import { flatConfigs as importXFlatConfigs } from "eslint-plugin-import-x" ;
910import packageJson from "eslint-plugin-package-json" ;
1011import globals from "globals" ;
1112
@@ -33,6 +34,7 @@ export default defineConfig(
3334 extends : [
3435 ...tseslint . configs . recommendedTypeChecked ,
3536 ...tseslint . configs . stylistic ,
37+ importXFlatConfigs . typescript ,
3638 ] ,
3739 languageOptions : {
3840 parserOptions : {
@@ -42,13 +44,12 @@ export default defineConfig(
4244 } ,
4345 plugins : {
4446 prettier : prettierPlugin ,
45- import : importPlugin ,
4647 } ,
4748 settings : {
48- "import/resolver" : {
49- typescript : { project : "./tsconfig.json" } ,
50- } ,
51- "import/internal-regex" : "^@/" ,
49+ "import-x /resolver-next " : [
50+ createTypeScriptImportResolver ( { project : "./tsconfig.json" } ) ,
51+ ] ,
52+ "import-x /internal-regex" : "^@/" ,
5253 } ,
5354 rules : {
5455 // Prettier integration
@@ -83,7 +84,7 @@ export default defineConfig(
8384 "@typescript-eslint/array-type" : [ "error" , { default : "array-simple" } ] ,
8485
8586 // Import rules
86- "import/order" : [
87+ "import-x /order" : [
8788 "error" ,
8889 {
8990 groups : [
@@ -103,8 +104,8 @@ export default defineConfig(
103104 } ,
104105 ] ,
105106 "no-duplicate-imports" : "off" ,
106- "import/no-duplicates" : [ "error" , { "prefer-inline" : true } ] ,
107- "import/no-unresolved" : [ "error" , { ignore : [ "vscode" ] } ] ,
107+ "import-x /no-duplicates" : [ "error" , { "prefer-inline" : true } ] ,
108+ "import-x /no-unresolved" : [ "error" , { ignore : [ "vscode" ] } ] ,
108109
109110 // Custom AST selector rule
110111 "no-restricted-syntax" : [
@@ -123,9 +124,9 @@ export default defineConfig(
123124 {
124125 files : [ "test/**/*.ts" , "**/*.test.ts" , "**/*.spec.ts" ] ,
125126 settings : {
126- "import/resolver" : {
127- typescript : { project : "test/tsconfig.json" } ,
128- } ,
127+ "import-x /resolver-next " : [
128+ createTypeScriptImportResolver ( { project : "test/tsconfig.json" } ) ,
129+ ] ,
129130 } ,
130131 rules : {
131132 // vitest mocks trigger false positives for unbound-method
0 commit comments