-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.json
113 lines (112 loc) · 2.84 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb",
"airbnb-typescript",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"next/core-web-vitals",
"next/typescript",
"plugin:storybook/recommended"
],
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"jsx-a11y",
"import",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"prettier/prettier": ["error", { "endOfLine": "lf" }],
"react/react-in-jsx-scope": "off",
"import/prefer-default-export": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// TypeScript 프로젝트일 경우 기본 매개변수를 사용하는 것이 더 간결
"react/require-default-props": "off",
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling"],
"index"
],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
},
{
"pattern": "next/**",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react", "next"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
},
"ignorePatterns": [
"src/components/ui/**/*", // components/ui 디렉터리 내 모든 파일 무시
"src/components/common/CustomShadcnCalendar.tsx" // 특정 파일 무시
],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {}
}
},
"overrides": [
{
"files": [
"*.test.ts",
"*.stories.ts",
// shadcn 컴포넌트 경로
"src/components/ui/**/*.tsx"
],
"rules": {
// import/no-extraneous-dependencies 규칙
// 프로덕션 코드에서 필요한 패키지는 dependencies에 있어야 한다고 강제함
// 테스트 파일에 대해서는 no-extraneous-dependencies 규칙을 비활성화함
"import/no-extraneous-dependencies": "off"
}
},
{
"files": ["src/components/ui/**/*.tsx"],
"rules": {
// shadcn 컴포넌트 파일에 대해서는 jsx-props-no-spreading 규칙 비활성화
"react/jsx-props-no-spreading": "off"
}
}
]
}