forked from shockpkg/icon-encoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
507 lines (491 loc) · 11.3 KB
/
.eslintrc.yaml
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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
parser: '@typescript-eslint/parser'
plugins:
- eslint-plugin-import
- eslint-plugin-jsdoc
- '@typescript-eslint'
parserOptions:
ecmaVersion: 9
sourceType: module
project: ./tsconfig.eslint.json
extends:
- eslint:recommended
- prettier
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:import/recommended
- plugin:import/typescript
- plugin:jsdoc/recommended
env:
es6: true
commonjs: true
node: true
rules:
# Possible Errors:
no-await-in-loop: error
no-console: error
no-loss-of-precision: error
no-template-curly-in-string: error
no-unreachable: error
# Best Practices:
accessor-pairs: error
array-callback-return: error
block-scoped-var: error
consistent-return: error
default-case: error
eqeqeq: error
guard-for-in: error
max-classes-per-file:
- error
- 1
no-alert: error
no-caller: error
no-div-regex: error
no-else-return: error
no-eq-null: error
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-label: error
no-floating-decimal: error
no-implicit-globals: error
no-implied-eval: error
no-invalid-this: error
no-iterator: error
no-labels:
- error
- allowLoop: true
allowSwitch: true
no-lone-blocks: error
no-loop-func: error
no-multi-str: error
no-new: error
no-new-func: error
no-new-wrappers: error
no-octal-escape: 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: error
no-unused-expressions: error
no-useless-call: error
no-useless-concat: error
no-void: error
no-warning-comments: warn
radix: error
wrap-iife:
- error
- inside
yoda: error
# Strict Mode:
strict:
- error
- global
# Variables:
no-label-var: error
no-undef-init: error
no-undefined: error
# Using @typescript-eslint/no-unused-vars
no-unused-vars: off
# Node.js and CommonJS:
callback-return:
- error
- - callback
- cb
- next
- done
global-require: error
handle-callback-err: error
no-buffer-constructor: error
no-mixed-requires: error
no-new-require: error
no-path-concat: error
no-process-env: error
no-process-exit: error
no-sync: error
# Stylistic Issues:
array-bracket-spacing:
- error
- never
- singleValue: false
objectsInArrays: false
arraysInArrays: false
func-name-matching:
- error
- always
- includeCommonJSModuleExports: false
line-comment-position:
- error
- position: above
lines-between-class-members:
- error
- always
max-depth:
- error
- 6
max-len:
- error
- 80
- 4
- ignoreComments: false
ignoreUrls: true
ignorePattern: '^\s*(//|/\*)\s*eslint'
max-nested-callbacks:
- error
- 4
max-params:
- error
- 8
new-cap: error
no-bitwise: error
no-inline-comments: error
no-lonely-if: error
no-negated-condition: error
no-nested-ternary: error
no-new-object: error
no-unneeded-ternary:
- error
- defaultAssignment: false
one-var:
- error
- never
spaced-comment:
- error
- always
unicode-bom:
- error
- never
# ECMAScript 6:
arrow-body-style:
- error
- as-needed
no-confusing-arrow:
- error
- allowParens: true
no-duplicate-imports:
- error
- includeExports: false
no-useless-computed-key: error
no-useless-rename:
- error
- ignoreDestructuring: false
ignoreImport: false
ignoreExport: false
no-var: error
object-shorthand:
- error
- always
prefer-arrow-callback:
- error
- allowNamedFunctions: false
allowUnboundThis: true
prefer-const: error
prefer-destructuring: error
prefer-numeric-literals: error
prefer-rest-params: error
prefer-spread: error
prefer-template: error
symbol-description: error
# Import plugin:
import/no-deprecated: warn
import/no-extraneous-dependencies:
- error
- devDependencies: true
optionalDependencies: true
peerDependencies: true
import/no-unassigned-import: error
import/order:
- warn
- newlines-between: always
# JSDoc plugin:
jsdoc/check-indentation: warn
jsdoc/check-syntax: warn
jsdoc/match-description:
- warn
- tags:
param: true
returns: true
jsdoc/no-types: warn
jsdoc/require-description: warn
jsdoc/require-description-complete-sentence:
- warn
- tags:
- see
- copyright
jsdoc/require-param-type: off
jsdoc/require-returns-type: off
jsdoc/require-jsdoc:
- warn
- require:
ArrowFunctionExpression: true
ClassDeclaration: true
ClassExpression: true
FunctionDeclaration: true
FunctionExpression: true
MethodDefinition: true
checkGetters: true
checkSetters: true
jsdoc/tag-lines:
- warn
- never
- startLines: 1
# TypeScript Simple:
'@typescript-eslint/array-type': error
'@typescript-eslint/consistent-type-assertions': error
'@typescript-eslint/consistent-type-definitions': error
'@typescript-eslint/explicit-member-accessibility':
- error
- overrides:
constructors: no-public
'@typescript-eslint/func-call-spacing': error
'@typescript-eslint/member-delimiter-style': error
'@typescript-eslint/member-ordering':
- error
- default:
- public-static-field
- private-static-field
- public-instance-field
- private-instance-field
- public-constructor
- private-constructor
- public-instance-method
- protected-instance-method
- private-instance-method
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-unused-vars':
- error
- vars: all
args: none
'@typescript-eslint/no-use-before-define':
- error
- nofunc
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/unified-signatures': error
'@typescript-eslint/no-confusing-non-null-assertion': error
'@typescript-eslint/lines-around-comment':
- error
- beforeBlockComment: true
allowBlockStart: true
allowObjectStart: true
allowArrayStart: true
allowEnumStart: true
allowInterfaceStart: true
allowModuleStart: true
allowTypeStart: true
# TypeScript Project:
'@typescript-eslint/no-unnecessary-qualifier': error
'@typescript-eslint/prefer-includes': error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/prefer-string-starts-ends-with': error
'@typescript-eslint/promise-function-async': error
'@typescript-eslint/no-unnecessary-boolean-literal-compare':
- error
- allowComparingNullableBooleansToTrue: true
allowComparingNullableBooleansToFalse: true
'@typescript-eslint/naming-convention':
- error
- selector: default
format:
- camelCase
- selector: typeLike
format:
- PascalCase
- selector: interface
format:
- PascalCase
- selector: variable
format:
- camelCase
- PascalCase
- UPPER_CASE
leadingUnderscore: allow
trailingUnderscore: allow
- selector: parameter
format:
- camelCase
- PascalCase
leadingUnderscore: allow
- selector: class
format:
- PascalCase
- selector: memberLike
modifiers:
- public
format:
- camelCase
- PascalCase
- selector: memberLike
modifiers:
- protected
format:
- camelCase
- PascalCase
leadingUnderscore: require
- selector: memberLike
modifiers:
- private
format:
- camelCase
- PascalCase
leadingUnderscore: require
trailingUnderscore: require
- selector: memberLike
modifiers:
- public
- readonly
- static
format:
- UPPER_CASE
- selector: memberLike
modifiers:
- protected
- readonly
- static
format:
- UPPER_CASE
leadingUnderscore: require
- selector: memberLike
modifiers:
- private
- readonly
- static
format:
- UPPER_CASE
leadingUnderscore: require
trailingUnderscore: require
- selector: accessor
modifiers:
- public
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
- selector: accessor
modifiers:
- protected
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
leadingUnderscore: require
- selector: accessor
modifiers:
- private
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
leadingUnderscore: require
trailingUnderscore: require
- selector: accessor
modifiers:
- public
- static
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
- selector: accessor
modifiers:
- protected
- static
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
leadingUnderscore: require
- selector: accessor
modifiers:
- private
- static
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
leadingUnderscore: require
trailingUnderscore: require
- selector: property
format:
- camelCase
- PascalCase
- snake_case
- UPPER_CASE
leadingUnderscore: allow
trailingUnderscore: allow
overrides:
- files:
- '*.js'
- '*.jsx'
- '*.mjs'
- '*.mjsx'
- '*.ts'
- '*.tsx'
- files:
- '*.js'
- '*.jsx'
- '*.mjs'
- '*.mjsx'
rules:
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/no-unsafe-member-access': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-return': off
- files:
- '*.ts'
- '*.tsx'
rules:
jsdoc/no-types: warn
- files:
- '*.test.js'
- '*.test.jsx'
- '*.test.mjs'
- '*.test.mjsx'
- '*.test.ts'
- '*.test.tsx'
- '*.spec.js'
- '*.spec.jsx'
- '*.spec.mjs'
- '*.spec.mjsx'
- '*.spec.ts'
- '*.spec.tsx'
rules:
no-void: off
jsdoc/require-jsdoc: off
'@typescript-eslint/no-floating-promises':
- error
- ignoreVoid: true
- files:
- 'babel.config.js'
rules:
import/no-extraneous-dependencies:
- error
- devDependencies: true
optionalDependencies: false
peerDependencies: false
jsdoc/require-jsdoc: off
'@typescript-eslint/no-require-imports': off
'@typescript-eslint/no-var-requires': off
parserOptions:
sourceType: script
- files:
- 'bin/*.js'
rules:
no-console: off
no-prototype-builtins: off
jsdoc/require-jsdoc: off
'@typescript-eslint/naming-convention': off
'@typescript-eslint/no-require-imports': off
'@typescript-eslint/no-var-requires': off
'@typescript-eslint/no-unsafe-argument': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-return': off
'@typescript-eslint/restrict-template-expressions': off