1
+ /** @type {import("eslint").Linter.Config } */
1
2
module . exports = {
2
3
root : true ,
3
- env : {
4
- es6 : true ,
5
- node : true ,
6
- browser : true ,
7
- "shared-node-browser" : true ,
8
- } ,
9
- ignorePatterns : [ "node_modules/*" , "build/*" , "dist/*" , ".next/*" ] ,
10
-
11
- // ts, 최신 js, 모듈, JSX 파싱 설정
12
- parser : "@typescript-eslint/parser" ,
13
- parserOptions : {
14
- ecmaVersion : "latest" ,
15
- sourceType : "module" ,
16
- ecmaFeatures : { jsx : true } ,
17
- } ,
18
4
19
- extends : [
20
- "eslint:recommended" ,
21
- "plugin:@typescript-eslint/recommended" ,
22
- "plugin:react/recommended" ,
23
- "plugin:react-hooks/recommended" ,
24
- "plugin:import/recommended" , // errors + warnings
25
- "plugin:prettier/recommended" ,
26
- "next/core-web-vitals" ,
27
- ] ,
28
- plugins : [ "@typescript-eslint" , "react" , "react-hooks" , "import" , "sort-exports" , "prettier" ] ,
5
+ // https://nextjs.org/docs/app/building-your-application/configuring/eslint
6
+ extends : [ "next/core-web-vitals" , "next/typescript" , "prettier" ] ,
29
7
30
- settings : {
31
- "import/resolver" : { typescript : { } } ,
32
- next : {
33
- rootDir : [ "apps/*/" ] ,
34
- } ,
35
- } ,
36
8
rules : {
37
- "no-implicit-coercion" : "error" , // 암시적 타입 변환을 금지
38
-
39
- curly : [ "error" , "all" ] , // 모든 제어문 중괄호
40
9
eqeqeq : [ "error" , "always" , { null : "ignore" } ] , // 동등 비교(===, !==)를 사용. null 제외
41
-
10
+ "@typescript-eslint/consistent-type-imports" : "error" , // import type을 사용하도록 강제
11
+ "@typescript-eslint/no-empty-object-type" : "warn" ,
42
12
"import/order" : [
43
13
"error" ,
44
14
{
@@ -54,45 +24,29 @@ module.exports = {
54
24
group : "external" ,
55
25
position : "before" ,
56
26
} ,
27
+ {
28
+ pattern : "@/lib/**/*" ,
29
+ group : "external" ,
30
+ position : "after" ,
31
+ } ,
32
+ {
33
+ pattern : "@/hooks/**/*" ,
34
+ group : "external" ,
35
+ position : "after" ,
36
+ } ,
37
+ {
38
+ pattern : "@/components/**/*" ,
39
+ group : "external" ,
40
+ position : "after" ,
41
+ } ,
42
+ {
43
+ pattern : "@/constants/**/*" ,
44
+ group : "external" ,
45
+ position : "after" ,
46
+ } ,
57
47
] ,
58
48
pathGroupsExcludedImportTypes : [ "react" , "next" ] ,
59
49
} ,
60
50
] ,
61
- "sort-exports/sort-exports" : [ "error" , { sortDir : "asc" , pattern : "**/index.ts" } ] ,
62
-
63
- "@typescript-eslint/naming-convention" : [
64
- "error" ,
65
- {
66
- format : [ "camelCase" , "UPPER_CASE" , "PascalCase" ] ,
67
- selector : "variable" ,
68
- leadingUnderscore : "allow" ,
69
- } ,
70
- { format : [ "camelCase" , "PascalCase" ] , selector : "function" } ,
71
- { format : [ "PascalCase" ] , selector : "interface" } ,
72
- { format : [ "PascalCase" ] , selector : "typeAlias" } ,
73
- ] ,
74
- "@typescript-eslint/member-ordering" : [
75
- "error" ,
76
- {
77
- default : [
78
- "public-static-field" ,
79
- "private-static-field" ,
80
- "public-instance-field" ,
81
- "private-instance-field" ,
82
- "public-constructor" ,
83
- "private-constructor" ,
84
- "public-instance-method" ,
85
- "private-instance-method" ,
86
- ] ,
87
- } ,
88
- ] ,
89
- // ...rest 제외 사용하지 않는 변수 에러
90
- "@typescript-eslint/no-unused-vars" : [ "error" , { ignoreRestSiblings : true } ] ,
91
-
92
- "react/react-in-jsx-scope" : "off" , // React 17 이상에서 불필요
93
- "react/display-name" : "off" , // React.memo, React.forwardRef 때문에 끔
94
- "react/no-unknown-property" : [ "error" ] ,
95
-
96
- "prettier/prettier" : [ "warn" ] ,
97
51
} ,
98
52
} ;
0 commit comments