-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
172 lines (172 loc) · 4.08 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
module.exports = {
plugins: ['babel', '@typescript-eslint', 'react-hooks', 'prettier'],
extends: ['airbnb', 'plugin:@typescript-eslint/recommended', 'plugin:import/typescript', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false,
},
},
],
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/semi': ['error'],
'arrow-parens': 'off',
'babel/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
},
],
camelcase: 'off',
curly: ['error', 'all'],
'class-methods-use-this': 'off',
'default-case': 'off',
eqeqeq: 'error',
'import/extensions': 'off',
'import/no-cycle': 'off',
'import/prefer-default-export': 'off',
indent: [
'error',
'tab',
{
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
FunctionDeclaration: {
parameters: 1,
body: 1,
},
FunctionExpression: {
parameters: 1,
body: 1,
},
CallExpression: {
arguments: 1,
},
ArrayExpression: 1,
ObjectExpression: 1,
ImportDeclaration: 1,
flatTernaryExpressions: false,
},
],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'lines-between-class-members': 'off',
'max-classes-per-file': ['off'],
'max-len': [
'error',
{
code: 150,
ignorePattern: '^import\\s.+\\sfrom\\s.+;$',
ignoreUrls: true,
},
],
'require-await': 'error',
'no-alert': 'off',
'no-await-in-loop': 'warn',
'no-case-declarations': 'warn',
'no-continue': 'off',
'no-console': 'error',
'no-dupe-class-members': 'off',
'no-shadow': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts', '**/webpack.*.ts'] }],
'no-mixed-operators': 'off',
'no-param-reassign': 'error',
'no-plusplus': 'off',
'no-prototype-builtins': 'off',
'no-restricted-globals': 'off',
'no-tabs': 'off',
'no-undef': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
'object-curly-newline': 'off',
radix: 'off',
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
'react/jsx-indent': [
'error',
'tab',
{
checkAttributes: true,
indentLogicalExpressions: true,
},
],
'react/jsx-indent-props': ['error', 'tab'],
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react/jsx-one-expression-per-line': [
'error',
{
allow: 'single-child',
},
],
'react/jsx-props-no-spreading': 'off',
'react/sort-comp': 'off',
semi: 'off',
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'error',
'prettier/prettier': 'error',
},
overrides: [
{
files: ['**/*.tsx'],
rules: {
'react/prop-types': 0,
'react/no-unused-prop-types': 0,
'react/require-default-props': 'off',
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['*.js', '*.es6'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['*.d.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
globals: {},
env: {
es6: true,
node: true,
browser: true,
jest: true,
},
};