11import eslint from '@eslint/js' ;
22import tseslint from 'typescript-eslint' ;
3+ import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript' ;
4+ import { createNodeResolver , importX } from 'eslint-plugin-import-x' ;
35import reactPlugin from 'eslint-plugin-react' ;
46import reactHooksPlugin from 'eslint-plugin-react-hooks' ;
57import prettierPlugin from 'eslint-plugin-prettier' ;
6- import importPlugin from 'eslint-plugin-import' ;
78import globals from 'globals' ;
89
910export default tseslint . config (
@@ -33,17 +34,18 @@ export default tseslint.config(
3334 react : reactPlugin ,
3435 'react-hooks' : reactHooksPlugin ,
3536 prettier : prettierPlugin ,
36- import : importPlugin ,
37+ ' import-x' : importX ,
3738 } ,
3839 settings : {
3940 react : {
4041 version : 'detect' ,
4142 } ,
42- 'import/resolver' : {
43- typescript : {
43+ 'import-x /resolver-next ' : [
44+ createTypeScriptImportResolver ( {
4445 alwaysTryTypes : true ,
45- } ,
46- } ,
46+ } ) ,
47+ createNodeResolver ( ) ,
48+ ] ,
4749 } ,
4850 rules : {
4951 'no-useless-assignment' : 'off' ,
@@ -53,7 +55,7 @@ export default tseslint.config(
5355 'react/react-in-jsx-scope' : 'off' ,
5456 'react-hooks/exhaustive-deps' : 'warn' ,
5557 'react-hooks/rules-of-hooks' : 'error' ,
56- 'import/order' : [
58+ 'import-x /order' : [
5759 'error' ,
5860 {
5961 groups : [
@@ -79,8 +81,8 @@ export default tseslint.config(
7981 } ,
8082 } ,
8183 ] ,
82- 'import/no-duplicates' : 'error' ,
83- 'import/no-unresolved' : 'error' ,
84+ 'import-x /no-duplicates' : 'error' ,
85+ 'import-x /no-unresolved' : 'error' ,
8486 '@typescript-eslint/consistent-type-imports' : 'error' ,
8587 '@typescript-eslint/no-unused-vars' : [
8688 'error' ,
0 commit comments