-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
175 lines (168 loc) · 5.18 KB
/
.eslintrc.js
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'no-relative-import-paths', 'prettier'],
extends: ['next', 'plugin:@typescript-eslint/recommended', 'prettier'],
env: {
node: true,
browser: true,
},
parserOptions: {
project: ['./tsconfig.json', './tsconfig.server.json'],
},
rules: {
'prettier/prettier': 'error',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'no-multi-assign': 'off',
'no-param-reassign': 'off',
'no-continue': 'off',
'no-console': 'warn',
'no-shadow': 'warn',
'array-callback-return': 'off',
'no-case-declarations': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
'consistent-return': 'off',
'guard-for-in': 'off',
'no-redeclare': 'off',
'max-classes-per-file': 'off',
'prefer-destructuring': 'warn',
'no-nested-ternary': 'off',
/** 상대 경로 import 방지 */
'no-relative-import-paths/no-relative-import-paths': [
'error',
{
allowSameFolder: true,
prefix: '@',
},
],
'prettier/prettier': 'error',
'react/display-name': 'warn',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key': 'warn',
'react/jsx-no-target-blank': 'off',
'react/no-unescaped-entities': 'off',
'@next/next/no-html-link-for-pages': 'off',
'@next/next/no-img-element': 'off',
'import/no-default-export': 'off',
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'import/export': 'off',
'import/no-named-as-default': 'warn',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/order': [
'warn',
{
groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: '@/**',
group: 'external',
position: 'after',
},
{
pattern: './*.scss',
group: 'sibling',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': [
2,
{
labelComponents: ['CustomInputLabel'],
labelAttributes: ['label'],
controlComponents: ['CustomInput'],
depth: 3,
},
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/triple-slash-reference': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-shadow': 'warn',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-namespace': 'warn',
'@typescript-eslint/no-redeclare': 'warn',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-empty': ['error', { allowEmptyCatch: true }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'parameter',
format: ['strictCamelCase'], // Change if you want to.
leadingUnderscore: 'allow',
},
],
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
},
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
overrides: [
{
files: ['*.test.tsx', '*.test.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: [
'**/config/**/*.{ts,tsx}',
'**/test/**/*.{ts,tsx}',
'**/*.{test,spec}.{ts,tsx}',
'**/scripts/**/*.{ts,tsx}',
'**/jest.config.js',
'**/jest.config.e2e.js',
'**/next.config.js',
'**/webpack.config.js',
'**/__tests__/**/*.{ts,tsx}',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
packageDir: ['./'],
},
],
},
},
],
}