1- import { fixupPluginRules } from '@eslint/compat' ;
21import js from '@eslint/js' ;
3- import importPlugin from 'eslint-plugin-import' ;
2+ import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript' ;
3+ import importXPlugin from 'eslint-plugin-import-x' ;
44import jsxA11y from 'eslint-plugin-jsx-a11y' ;
55import react from 'eslint-plugin-react' ;
66import reactHooks from 'eslint-plugin-react-hooks' ;
@@ -14,17 +14,21 @@ export default tseslint.config(
1414 tseslint . configs . eslintRecommended ,
1515 ...tseslint . configs . recommended ,
1616 ...tseslint . configs . stylistic ,
17- /* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */
18- importPlugin . flatConfigs . errors ,
19- importPlugin . flatConfigs . warnings ,
20- importPlugin . flatConfigs . typescript ,
21- /* eslint-enable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */
17+ importXPlugin . flatConfigs . errors ,
18+ importXPlugin . flatConfigs . warnings ,
2219 react . configs . flat . recommended ,
2320
2421 {
2522 plugins : {
2623 'jsx-a11y' : jsxA11y ,
27- 'react-hooks' : fixupPluginRules ( reactHooks ) ,
24+ 'react-hooks' : reactHooks ,
25+ } ,
26+
27+ settings : {
28+ 'import-x/resolver-next' : [ createTypeScriptImportResolver ( ) ] ,
29+ 'react' : {
30+ version : 'detect' ,
31+ } ,
2832 } ,
2933
3034 languageOptions : {
@@ -36,12 +40,6 @@ export default tseslint.config(
3640 } ,
3741 } ,
3842
39- settings : {
40- react : {
41- version : 'detect' ,
42- } ,
43- } ,
44-
4543 rules : {
4644 'array-callback-return' : 'warn' ,
4745 'default-case' : 'off' ,
@@ -177,11 +175,11 @@ export default tseslint.config(
177175 'no-useless-constructor' : 'off' ,
178176 '@typescript-eslint/no-useless-constructor' : 'warn' ,
179177
180- // https://github.com/benmosher /eslint-plugin-import/tree/main /docs/rules
181- 'import/first' : 'error' ,
182- 'import/no-amd' : 'error' ,
183- 'import/no-anonymous-default-export' : 'off' ,
184- 'import/no-webpack-loader-syntax' : 'error' ,
178+ // https://github.com/un-ts /eslint-plugin-import-x /tree/master /docs/rules
179+ 'import-x /first' : 'error' ,
180+ 'import-x /no-amd' : 'error' ,
181+ 'import-x /no-anonymous-default-export' : 'off' ,
182+ 'import-x /no-webpack-loader-syntax' : 'error' ,
185183
186184 // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
187185 'react/display-name' : 'off' ,
@@ -291,7 +289,7 @@ export default tseslint.config(
291289 'radix' : [ 'error' , 'as-needed' ] ,
292290
293291 // import 순서를 강제한다.
294- 'import/order' : [
292+ 'import-x /order' : [
295293 'error' ,
296294 {
297295 alphabetize : { order : 'asc' , caseInsensitive : true } ,
@@ -306,10 +304,10 @@ export default tseslint.config(
306304 ] ,
307305
308306 // 자연스러운 import를 방해해서 적용하지 않는다. 예) import Redis from 'ioredis';
309- 'import/no-named-as-default' : 'off' ,
307+ 'import-x /no-named-as-default' : 'off' ,
310308
311309 // 과도한 import를 강요해서 적용하지 않는다. 예) import dayjs from 'dayjs'; dayjs.extend(); -> import { extend } from 'dayjs';
312- 'import/no-named-as-default-member' : 'off' ,
310+ 'import-x /no-named-as-default-member' : 'off' ,
313311
314312 // 단순 배열 타입에만 [] 문법을 사용한다.
315313 '@typescript-eslint/array-type' : [ 'error' , { default : 'array-simple' } ] ,
0 commit comments