-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
78 lines (78 loc) · 2.19 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
70
71
72
73
74
75
76
77
78
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'svg.d.ts', 'public'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugins: ['react-refresh', '@typescript-eslint', 'prettier'],
rules: {
'consistent-return': 'off',
'jsx-a11y/control-has-associated-label': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'import/no-extraneous-dependencies': 'off',
'react/no-array-index-key': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration', // 컴포넌트 선언 시 function 선언문 사용
unnamedComponents: 'arrow-function',
},
],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/react-in-jsx-scope': 'off',
'import/extensions': ['off'],
'@typescript-eslint/naming-convention': [
// 네이밍 컨벤션
'warn',
{
selector: 'typeAlias', // 타입 선언
format: ['PascalCase'],
},
{
selector: 'interface', // 인터페이스 선언
format: ['PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
},
{
selector: 'function', // exported function (컴포넌트 명)
format: ['PascalCase'],
modifiers: ['exported'],
},
{
selector: 'function', // function
format: ['camelCase'],
},
],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {}, // 추가된 부분
},
},
};