forked from apitable/apitable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
185 lines (185 loc) · 4.13 KB
/
.eslintrc
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
173
174
175
176
177
178
179
180
181
182
183
184
185
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"vika",
"@typescript-eslint",
"react-hooks",
"react"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-var-requires": 0,
"vika/use-t-function": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/display-name": 0,
"no-extra-boolean-cast": 0,
"no-case-declarations": 0,
"no-multi-spaces": "warn",
"no-prototype-builtins": 0,
// Direct use of built-in functions on the prototype chain is not allowed
"@typescript-eslint/ban-types": 0,
"jsx-a11y/anchor-is-valid": 0,
"prefer-spread": 0,
"no-async-promise-executor": 0,
// Promises are not allowed to wrap async execution functions
"prefer-rest-params": 0,
// replace arguments with rest
"@typescript-eslint/no-inferrable-types": 0,
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-non-null-assertion": 0,
// Do not allow the use of ts! make assertion
"@typescript-eslint/no-explicit-any": 0,
// any is not allowed
"semi": "off",
"@typescript-eslint/semi": 1,
"comma-dangle": [
"warn",
"only-multiline"
],
"max-len": [
// The maximum number of characters allowed on a single line
"warn",
{
"code": 150
}
],
"no-console": 0,
"no-debugger": 1,
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
// Whether spaces are allowed before the parentheses of the function
"space-before-function-paren": [
"warn",
"never"
],
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "enumMember",
"format": [
"PascalCase",
"UPPER_CASE"
]
},
{
"selector": "interface",
"prefix": [
"I"
],
"format": [
"PascalCase"
]
},
{
"selector": "typeLike",
// "prefix": [
// "I"
// ],
"format": [
"PascalCase"
]
},
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow",
// variable names start with _
"trailingUnderscore": "forbid"
// variable names end with _
},
{
"selector": "parameter",
"format": [
"camelCase",
"PascalCase"
],
"leadingUnderscore": "allow"
}
],
"react/self-closing-comp": [
"warn",
{
"component": true,
"html": true
}
],
"react/jsx-equals-spacing": [
2,
"never"
],
"react/jsx-wrap-multilines": 0,
"no-fallthrough": 1,
"no-unused-expressions": 0,
// disallow unused expressions
"quote-props": [
"warn",
"as-needed"
],
"quotes": [
"warn",
"single",
{
"avoidEscape": true
}
],
"no-multiple-empty-lines": [
"warn",
{
"max": 1,
"maxEOF": 1
}
],
"react/jsx-boolean-value": [
"warn",
"never"
],
"indent": [
"warn",
2,
{
"SwitchCase": 1,
"VariableDeclarator": "first",
"MemberExpression": 1,
"flatTernaryExpressions": false
}
],
"no-inner-declarations": 0,
// "default-case": 1, // requires a default case in the switch statement
"no-else-return": 1,
// Prohibit else in the if statement after return
"array-bracket-spacing": 1,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"require-await": 2,
"@typescript-eslint/ban-ts-comment": 0,
// object
"object-curly-spacing": [
"warn",
"always",
{
"objectsInObjects": false
}
]
}
}