-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
85 lines (77 loc) ยท 2.31 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier', // prettier์ ํตํฉํ์ฌ ์ฝ๋ ์คํ์ผ ์ ์ฉ
],
rules: {
// ์ผ๋ฐ ํจ์ ์ฌ์ฉ
'prefer-arrow-callback': 'off',
'func-names': ['error', 'never'],
// PascalCase ๊ท์น ๊ฐ์
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: 'typeLike', // ํด๋์ค, ์ธํฐํ์ด์ค, ํ์
, ์ปดํฌ๋ํธ
format: ['PascalCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
prefix: ['I'], // ์ธํฐํ์ด์ค ์ด๋ฆ์ I๋ฅผ ์ ๋์ฌ๋ก ์ฌ์ฉ
},
],
// ํจ์๋ช
์ ๋์ฌ+๋ช
์ฌ ์กฐํฉ์ผ๋ก ์์ฑ, ์นด๋ฉ์ผ์ด์ค ๊ฐ์
camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
'func-names': 'off', // ํจ์๋ช
๊ฐ์ ๊ท์น, ์: handleEvent
// Named Exports ๊ฐ์
'import/prefer-default-export': 'off',
// const ๊ธฐ๋ณธ ์ฌ์ฉ, let์ ๋ณ๊ฒฝ ์๋ง ์ฌ์ฉ
'prefer-const': 'error',
'no-var': 'error',
// ๊ณ ์ฐจ ํจ์ ์ฌ์ฉ ์งํฅ
'array-callback-return': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for...in loops are not allowed. Use Object.keys or other utilities.',
},
{
selector: 'ForOfStatement',
message: 'for...of loops are not allowed. Use array methods instead.',
},
],
// Boolean ํ์
์ ๋์ฌ is ์ฌ์ฉ
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
},
],
// Enum ์ฌ์ฉ ์งํฅ
'@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
'no-shadow': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
'import/resolver': {
typescript: {},
},
},
};