-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
139 lines (134 loc) · 4.09 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
module.exports = {
root: true,
env: {
browser: true,
commonjs: true,
node: true,
es2021: true,
},
parser: '@typescript-eslint/parser',
extends: [
'airbnb',
'airbnb/hooks',
'plugin:import/errors',
'plugin:import/warnings',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: [ '@typescript-eslint', 'import', 'react', 'react-hooks', 'html', ],
rules: {
// 일반 규칙
'no-console': 'off',
'no-unused-vars': 'warn',
'no-unexpected-multiline': 'off',
'no-use-before-define': 'off',
'spaced-comment': 'off',
'no-param-reassign': 'off',
'eol-last': [ 'warn', 'always', ],
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'array-callback-return': 'off',
'consistent-return': 'off',
'no-nested-ternary': 'off',
quotes: [ 'warn', 'single', { allowTemplateLiterals: true, }, ],
semi: [ 'error', 'always', ],
'array-bracket-spacing': [
'warn',
'always',
{
arraysInArrays: true,
singleValue: true,
objectsInArrays: true,
},
],
'object-curly-spacing': [ 'warn', 'always', ],
'no-shadow': 'off',
indent: 'off',
'comma-dangle': [ 'warn', {
arrays: 'always',
functions: 'never',
objects: 'always',
imports: 'never',
exports: 'never',
}, ],
'jsx-quotes': [ 'error', 'prefer-single', ],
'linebreak-style': 'off',
'prefer-const': 'off',
'max-len': 'off',
'no-else-return': 'off',
'no-lonely-if': 'off',
'global-require': 'off',
'class-methods-use-this': 'off',
'no-useless-constructor': 'off',
'no-useless-return': 'off',
'lines-between-class-members': 'off',
'arrow-body-style': 'off',
// 임포트 규칙
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/no-dynamic-require': 'off',
'import/prefer-default-export': 'off',
// 리액트 규칙
'react/jsx-props-no-spreading': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-filename-extension': [ 'error', {
extensions: [ 'js', 'jsx', '.ts', '.tsx', ],
}, ],
'react/no-danger': 'off',
'react/jsx-curly-brace-presence': [
'warn',
{ props: 'never', children: 'never', },
],
'react/require-default-props': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/function-component-definition': 'off',
'react/jsx-no-useless-fragment': 'off',
'react/no-arrow-function-lifecycle': 'off',
'react/no-invalid-html-attribute': 'off',
'react/no-unused-class-component-methods': 'off',
'react/button-has-type': 'off',
// 리액트 훅스 규칙
'react-hooks/exhaustive-deps': 'off',
// jsx 규칙
'jsx-a11y/anchor-is-valid': [
'error',
{
components: [ 'Link', ],
specialLink: [ 'hrefLeft', 'hrefRight', ],
aspects: [ 'invalidHref', 'preferButton', ],
},
],
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
// 타입스크립트 규칙
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/indent': [ 'warn', 2, {
SwitchCase: 1,
FunctionExpression: {
parameters: 1,
},
ignoredNodes: [
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key',
],
}, ],
},
};