-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.yml
319 lines (317 loc) · 7.19 KB
/
.eslintrc.yml
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
env:
browser: true
es6: true
node: true
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
# This causes an error. See: https://github.com/typescript-eslint/typescript-eslint/issues/864
# - 'plugin:@typescript-eslint/recommended-requiring-type-checking'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
overrides:
- files: "*.js"
rules:
'@typescript-eslint/no-var-requires':
- off
- files: "*.test.js"
rules:
no-undef:
- off
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2019
sourceType: module
# project:
# - './tsconfig.json'
plugins:
- '@typescript-eslint'
rules:
indent:
- error
- 4
linebreak-style:
- error
- windows
quotes:
- error
- double
# This is turned off because it does not work.
semi:
- off
max-len:
- warn
- 120
no-await-in-loop:
- error
array-callback-return:
- warn
curly:
- off
default-case:
- error
no-template-curly-in-string:
- error
consistent-return:
- error
dot-notation:
- warn
eqeqeq:
- error
guard-for-in:
- warn
no-caller:
- error
no-case-declarations:
- error
no-eq-null:
- error
no-eval:
- error
no-extend-native:
- error
no-extra-bind:
- error
no-fallthrough:
- warn
no-floating-decimal:
- error
no-implied-eval:
- error
no-invalid-this:
- error
no-iterator:
- error
no-implicit-coercion:
- error
no-loop-func:
- error
no-magic-numbers:
- off
no-multi-str:
- error
no-new:
- error
no-new-func:
- error
no-new-wrappers:
- error
no-proto:
- error
no-return-assign:
- error
no-return-await:
- error
no-script-url:
- error
no-self-compare:
- error
no-sequences:
- error
no-throw-literal:
- error
no-unmodified-loop-condition:
- warn
no-useless-call:
- error
no-useless-catch:
- error
no-useless-escape:
- warn
# This rule needs to be off, because named capture groups are not widely
# supported, and might never be. MDN suggests against using them entirely.
# See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Browser_compatibility
prefer-named-capture-group:
- off
prefer-promise-reject-errors:
- error
radix:
- error
# Turned off because sometimes an interface requires a callback that returns
# a `Promise`, even though nothing in the callback `await`s.
require-await:
- off
# Turned off because using the Unicode flag makes certain parts of regexp not
# work as I would expect them to work.
require-unicode-regexp:
- off
no-label-var:
- warn
no-shadow:
- error
no-use-before-define:
- error
handle-callback-err:
- warn
no-buffer-constructor:
- error
no-mixed-requires:
- error
no-new-require:
- error
no-path-concat:
- error
max-params:
- warn
- 5
no-lonely-if:
- error
no-mixed-operators:
- error
no-trailing-spaces:
- error
no-unneeded-ternary:
- error
no-whitespace-before-property:
- error
nonblock-statement-body-position:
- error
object-curly-newline:
- error
object-curly-spacing:
- error
- always
object-property-newline:
- warn
operator-linebreak:
- error
- before
padded-blocks:
- error
- never
semi-style:
- error
- last
space-before-blocks:
- error
- always
space-before-function-paren:
- error
- always
space-in-parens:
- error
- never
# space-unary-ops
spaced-comment:
- error
- always
switch-colon-spacing:
- error
template-tag-spacing:
- error
- never
arrow-spacing:
- error
arrow-parens:
- warn
arrow-body-style:
- warn
generator-star-spacing:
- error
no-confusing-arrow:
- error
- allowParens: true
no-duplicate-imports:
- error
# This rule does not check for readonly parameters in Typescript, where
# empty constructors still have a use.
no-useless-constructor:
- off
template-curly-spacing:
- error
- never
yield-star-spacing:
- error
eol-last:
- error
brace-style:
- error
- 1tbs
comma-dangle:
- error
- always-multiline
func-call-spacing:
- error
- never
# Off because there is a legitimate use case for displaying small array
# elements all on one line, but wrapping lines at the max-len column.
array-element-newline:
- off
array-bracket-newline:
- off
key-spacing:
- error
- beforeColon: false
afterColon: true
mode: minimum
line-comment-position:
- off
no-parameter-properties:
- off
# I need to determine my opinion on this one.
# '@typescript-eslint/array-type':
# - error
# This one causes an error.
# '@typescript-eslint/await-thenable':
# - error
'@typescript-eslint/camelcase':
- off
'@typescript-eslint/no-inferrable-types':
- off
# Empirically, this rule has been more of a nuisance than it is worth. I
# often deal with free-form JSON, which makes this a nightmare.
'@typescript-eslint/no-explicit-any':
- off
# Rule not found.
# prefer-regex-literals:
# - error
prefer-numeric-literals:
- error
use-isnan:
- error
no-array-constructor:
- error
# Rule sourced from AirBnB's rules.
# See: https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js.
no-restricted-properties:
- error
- object: 'arguments'
property: 'callee'
message: 'arguments.callee is deprecated.'
- object: 'global'
property: 'isFinite'
message: 'Please use Number.isFinite instead.'
- object: 'self'
property: 'isFinite'
message: 'Please use Number.isFinite instead.'
- object: 'window'
property: 'isFinite'
message: 'Please use Number.isFinite instead.'
- object: 'global'
property: 'isNaN'
message: 'Please use Number.isNaN instead.'
- object: 'self'
property: 'isNaN'
message: 'Please use Number.isNaN instead.'
- object: 'window'
property: 'isNaN'
message: 'Please use Number.isNaN instead.'
- property: '__defineGetter__'
message: 'Please use Object.defineProperty instead.'
- property: '__defineSetter__'
message: 'Please use Object.defineProperty instead.'
- object: 'Math'
property: 'pow'
message: 'Use the exponentiation operator (**) instead.'
# Rule sourced from AirBnB's rules.
# See: https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js.
no-restricted-globals:
- error
- name: isFinite
message: 'Please use Number.isFinite instead.'
- name: isNaN
message: 'Please use Number.isNaN instead.'
'@typescript-eslint/no-empty-function':
- off