-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.cjs
69 lines (68 loc) ยท 1.86 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
plugins: ['react', '@typescript-eslint', 'prettier'],
settings: {
react: {
version: 'detect', // React ๋ฒ์ ์ ์๋ ๊ฐ์ง
},
},
rules: {
'react/react-in-jsx-scope': 'off', // React import๊ฐ ๋ถํ์ํ๋๋ก ์ค์
'no-undef': 'off', // 'module' ๊ด๋ จ ์๋ฌ ๋ฐฉ์ง
'react/jsx-no-useless-fragment': 'off', // React Fragment (<></>)๊ฐ ๋จ์ผ ์์์ ๊ฐ์ ๋๋ ํ์ฉ
'import/no-extraneous-dependencies': 'off',
'react/no-array-index-key': 'off', // index key ์ด์ฉ
'react/function-component-definition': [
'off',
{
namedComponents: 'arrow-function',
},
], // ํ์ดํ ํจ์ ์ด์ฉ
'react/require-default-props': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/label-has-associated-control': [
2,
{
some: ['nesting', 'id'],
},
],
'no-param-reassign': 'off',
'@typescript-eslint/naming-convention': [
'error',
// ์ธํฐํ์ด์ค ์ด๋ฆ์ PascalCase๋ฅผ ์ฌ์ฉํ๋, 'I'๋ก ์์ํ์ง ์์์ผ ํจ
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
// ํ์
๋ณ์นญ์ PascalCase๋ฅผ ์ฌ์ฉํด์ผ ํจ
{
selector: 'typeAlias',
format: ['PascalCase'],
},
],
},
};