-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
78 lines (76 loc) · 1.84 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
module.exports = {
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'react', 'import'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'react/jsx-uses-vars': 'error', // var로 JSX할당하면 에러
'react/button-has-type': 'error', //button에 타입지정안하면 에러
'react/jsx-sort-props': [
// JSX prop을 정렬해줌
'warn',
{
callbacksLast: true,
shorthandFirst: true,
ignoreCase: true,
reservedFirst: true,
},
],
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration',
},
],
'react-hooks/exhaustive-deps': 'off',
'no-multiple-empty-lines': 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }], // console.log() 금지
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'type', 'unknown'],
pathGroups: [
{
pattern: '{.,..}/**/*.styled',
group: 'object',
},
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
}