forked from wildberries-tech/ui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.yaml
673 lines (668 loc) · 20.6 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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
---
root: true
ignorePatterns:
- '*.pcss.d.ts'
- preview-head.html
- manager-head.html
- node_modules
- .git
- .idea
overrides:
# YAML files (yaml, yml)
- parser: yaml-eslint-parser
parserOptions:
defaultYAMLVersion: '1.2'
files:
- '*.yaml'
- '*.yml'
plugins:
- yml
rules:
yml/block-mapping-colon-indicator-newline: error
yml/block-mapping-question-indicator-newline: error
yml/block-mapping: error
yml/block-sequence-hyphen-indicator-newline: error
yml/block-sequence: error
yml/file-extension: error
yml/no-empty-document: error
yml/no-empty-key: error
yml/no-empty-mapping-value: error
yml/no-empty-sequence-entry: error
yml/no-tab-indent: error
yml/plain-scalar: error
yml/require-string-key: error
yml/flow-mapping-curly-newline: error
yml/flow-sequence-bracket-newline: error
yml/flow-sequence-bracket-spacing: error
yml/key-spacing: error
yml/no-irregular-whitespace: error
yml/no-multiple-empty-lines: error
yml/spaced-comment: error
yml/flow-mapping-curly-spacing:
- error
- always
- arraysInObjects: false
objectsInObjects: true
yml/quotes:
- error
- prefer: single
avoidEscape: true
yml/indent:
- error
- 2
- indentBlockSequences: true
indicatorValueIndent: 2
yml/key-name-casing: off
# HTML files (html, htm)
- parser: '@html-eslint/parser'
files:
- '*.html'
- '*.htm'
plugins:
- '@html-eslint'
rules:
'@html-eslint/require-doctype': error
'@html-eslint/no-duplicate-id': error
'@html-eslint/no-inline-styles': error
'@html-eslint/require-li-container': error
'@html-eslint/no-obsolete-tags': error
'@html-eslint/require-closing-tags': error
'@html-eslint/require-meta-charset': error
'@html-eslint/no-target-blank': error
'@html-eslint/no-duplicate-attrs': error
'@html-eslint/require-button-type': error
'@html-eslint/no-multiple-h1': error
'@html-eslint/require-lang': error
'@html-eslint/require-meta-description': error
'@html-eslint/require-title': error
'@html-eslint/no-abstract-roles': error
'@html-eslint/no-accesskey-attrs': error
'@html-eslint/no-aria-hidden-body': error
'@html-eslint/no-non-scalable-viewport': error
'@html-eslint/no-skip-heading-levels': error
'@html-eslint/require-frame-title': error
'@html-eslint/require-img-alt': error
'@html-eslint/require-meta-viewport': error
'@html-eslint/element-newline': error
'@html-eslint/no-extra-spacing-attrs': error
'@html-eslint/no-multiple-empty-lines': error
'@html-eslint/no-trailing-spaces': error
'@html-eslint/quotes': error
'@html-eslint/indent':
- error
- 4
'@html-eslint/id-naming-convention':
- error
- kebab-case
'@html-eslint/require-attrs':
- error
- tag: svg
attr: viewBox
- tag: a
attr: title
- tag: input
attr: name
- tag: input
attr: type
# JSON files (json)
- files:
- '*.json'
plugins:
- json
rules:
json/*: error
# TypeScript files (ts, tsx)
- parser: '@typescript-eslint/parser'
files:
- '*.ts'
- '*.tsx'
- '*.js'
parserOptions:
errorOnUnknownASTType: true
project: ./tsconfig.json
jsx: true
ecmaFeatures:
jsx: true
settings:
react:
version: detect
import/extensions:
- .ts
- .tsx
- .js
import/parsers:
'@typescript-eslint/parser':
- .ts
- .tsx
- .js
import/internal-regex:
- classnames/bind
import/resolver:
node:
extensions:
- .ts
- .tsx
- .js
typescript:
extensions:
- .ts
- .tsx
project: ./tsconfig.json
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
plugins:
- '@typescript-eslint'
- react
- import
rules:
react/boolean-prop-naming: error
react/default-props-match-prop-types: error
react/display-name: off
react/forbid-component-props:
- error
- forbid:
- style
react/forbid-dom-props: error
react/forbid-elements: error
react/forbid-foreign-prop-types: error
react/hook-use-state: error
react/iframe-missing-sandbox: error
react/jsx-child-element-spacing: off
react/jsx-closing-tag-location: error
react/jsx-curly-spacing: error
react/jsx-equals-spacing: error
react/jsx-filename-extension:
- error
- extensions:
- .tsx
react/jsx-handler-names: error
react/jsx-key: error
react/jsx-newline:
- error
- prevent: true
react/jsx-no-bind: off
react/jsx-no-comment-textnodes: error
react/jsx-no-constructed-context-values: error
react/jsx-no-duplicate-props: error
react/jsx-no-leaked-render: error
react/jsx-no-literal: off
react/jsx-no-script-url: error
react/jsx-no-target-blank: error
react/jsx-no-undef: error
react/jsx-no-useless-fragment: error
react/jsx-one-expression-per-line:
- error
- allow: literal
react/jsx-pascal-case:
- error
- allowAllCaps: true
react/jsx-props-no-multi-spaces: error
react/jsx-props-no-spreading: off
react/jsx-tag-spacing: error
react/jsx-uses-react: error
react/jsx-uses-vars: error
react/no-access-state-in-setstate: error
react/no-adjacent-inline-elements: error
react/no-array-index-key: off
react/no-arrow-function-lifecycle: error
react/no-danger: error
react/no-danger-with-children: error
react/no-deprecated: error
react/no-did-mount-set-state: error
react/no-did-update-set-state: error
react/no-direct-mutation-state: error
react/no-find-dom-node: error
react/no-invalid-html-attribute: error
react/no-is-mounted: error
react/no-multi-comp: error
react/no-namespace: error
react/no-object-type-as-default-prop: error
react/no-redundant-should-component-update: error
react/no-render-return-value: error
react/no-set-state: error
react/no-string-refs: error
react/no-this-in-sfc: error
react/no-typos: error
react/no-unescaped-entities: error
react/no-unknown-property: error
react/no-unsafe: error
react/no-unstable-nested-components: error
react/no-unused-class-component-methods: error
react/no-unused-prop-types: error
react/no-unused-state: error
react/no-will-update-set-state: error
react/prefer-read-only-props: error
react/prefer-stateless-function: error
react/prop-types: error
react/react-in-jsx-scope: error
react/require-default-props: off
react/require-optimization: error
react/require-render-return: error
react/self-closing-comp: error
react/state-in-constructor: error
react/style-prop-object: error
react/void-dom-elements-no-children: error
react/jsx-wrap-multilines:
- error
- declaration: parens-new-line
assignment: parens-new-line
return: parens-new-line
arrow: parens-new-line
condition: parens-new-line
logical: parens-new-line
prop: parens-new-line
react/jsx-max-props-per-line:
- error
- maximum: 1
react/jsx-indent:
- error
- 4
react/jsx-indent-props:
- error
- 4
react/jsx-fragments:
- error
- element
react/jsx-first-prop-new-line:
- error
- multiline-multiprop
react/jsx-curly-newline:
- error
- never
react/jsx-curly-brace-presence:
- error
- never
react/jsx-closing-bracket-location:
- error
- tag-aligned
react/jsx-boolean-value:
- error
- always
react/function-component-definition:
- error
- namedComponents: arrow-function
unnamedComponents: arrow-function
import/export: error
import/no-empty-named-blocks: error
import/no-extraneous-dependencies: off
import/no-mutable-exports: error
import/no-named-as-default: error
import/no-named-as-default-member: error
import/no-unused-modules: error
import/no-nodejs-modules: off
import/default: error
import/named: off
import/no-absolute-path: error
import/no-cycle: error
import/no-dynamic-require: error
import/no-relative-parent-imports: off
import/no-self-import: error
import/no-unresolved: off
import/no-useless-path-segments:
- error
- noUselessIndex: true
import/order:
- error
- newlines-between: always
warnOnUnassignedImports: true
groups:
- builtin
- external
- internal
- parent
- sibling
- index
pathGroups:
- pattern: '#core/**'
group: internal
- pattern: classnames/bind
group: external
block-spacing: off
brace-style: off
comma-dangle: off
comma-spacing: off
default-param-last: off
dot-notation: off
func-call-spacing: off
indent: off
key-spacing: off
keyword-spacing: off
lines-around-comment: off
lines-between-class-members: off
no-dupe-class-members: off
no-empty-function: off
no-extra-parens: off
no-extra-semi: off
no-implied-eval: off
no-invalid-this: off
no-loop-func: off
no-loss-of-precision: off
no-redeclare: off
no-restricted-imports: off
no-shadow: off
no-throw-literal: off
no-unused-expressions: off
no-unused-vars: off
no-use-before-define: off
no-useless-constructor: off
object-curly-spacing: off
padding-line-between-statements: off
quotes: off
require-await: off
no-return-await: off
semi: off
space-before-blocks: off
space-before-function-paren: off
space-infix-ops: off
no-mixed-spaces-and-tabs: error
array-bracket-spacing: error
arrow-parens: error
arrow-spacing: error
comma-style: error
computed-property-spacing: error
generator-star-spacing: error
implicit-arrow-linebreak: error
linebreak-style: error
no-multi-spaces: off
object-property-newline: error
rest-spread-spacing: error
semi-spacing: error
semi-style: error
space-unary-ops: error
switch-colon-spacing: error
template-curly-spacing: error
template-tag-spacing: error
unicode-bom: error
yield-star-spacing: error
operator-linebreak:
- error
- none
newline-per-chained-call:
- error
- ignoreChainWithDepth: 2
max-statements-per-line:
- error
- max: 1
jsx-quotes:
- error
- prefer-double
dot-location:
- error
- property
function-paren-newline:
- error
- multiline-arguments
function-call-argument-newline:
- error
- consistent
array-element-newline:
- error
- consistent
array-bracket-newline:
- error
- consistent
no-multiple-empty-lines:
- error
- max: 1
padded-blocks:
- error
- never
no-whitespace-before-property: error
nonblock-statement-body-position: error
space-in-parens: error
no-tabs: error
object-curly-newline:
- error
- multiline: true
consistent: true
'@typescript-eslint/array-type':
- error
- default: generic
readonly: generic
'@typescript-eslint/await-thenable': error
'@typescript-eslint/ban-tslint-comment': error
'@typescript-eslint/consistent-generic-constructors': error
'@typescript-eslint/consistent-indexed-object-style': error
'@typescript-eslint/consistent-type-assertions': error
'@typescript-eslint/consistent-type-definitions': error
'@typescript-eslint/consistent-type-exports': error
'@typescript-eslint/explicit-member-accessibility': error
'@typescript-eslint/member-delimiter-style':
- error
- multiline:
delimiter: comma
requireLast: false
singleline:
delimiter: comma
requireLast: false
'@typescript-eslint/method-signature-style': error
'@typescript-eslint/naming-convention':
- error
- format:
- StrictPascalCase
selector: interface
filter:
regex: '^(ImportMetaEnv|ImportMeta)$'
match: false
prefix:
- I
- format:
- StrictPascalCase
selector: typeAlias
prefix:
- T
- format:
- StrictPascalCase
selector: enum
prefix:
- E
- format:
- camelCase
- UPPER_CASE
selector:
- typeProperty
- typeMethod
- enumMember
- format:
- camelCase
- snake_case
- UPPER_CASE
- PascalCase
selector:
- parameterProperty
- objectLiteralProperty
filter:
regex: '^(#|[a-z-]+(__[a-z-]+)?(_[a-z-]+)?$)'
match: false
- format:
- camelCase
- PascalCase
selector:
- objectLiteralMethod
- classMethod
- classProperty
- function
- parameter
- format:
- camelCase
- UPPER_CASE
- PascalCase
selector:
- variable
- format:
- PascalCase
selector:
- class
- format:
- PascalCase
- camelCase
types:
- function
selector:
- variable
'@typescript-eslint/no-base-to-string': error
'@typescript-eslint/no-confusing-non-null-assertion': error
'@typescript-eslint/prefer-reduce-type-parameter': error
'@typescript-eslint/no-duplicate-enum-values': error
'@typescript-eslint/no-dynamic-delete': error
'@typescript-eslint/no-floating-promises': error
'@typescript-eslint/no-for-in-array': error
'@typescript-eslint/no-import-type-side-effects': error
'@typescript-eslint/no-invalid-void-type': error
'@typescript-eslint/no-meaningless-void-operator': error
'@typescript-eslint/no-misused-promises': error
'@typescript-eslint/no-mixed-enums': error
'@typescript-eslint/no-var-requires': off
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': error
'@typescript-eslint/no-redundant-type-constituents': error
'@typescript-eslint/no-require-imports': off
'@typescript-eslint/no-unnecessary-boolean-literal-compare': error
'@typescript-eslint/no-unnecessary-condition': error
'@typescript-eslint/no-unnecessary-type-arguments': error
'@typescript-eslint/no-unnecessary-type-assertion': error
'@typescript-eslint/no-unsafe-argument': off
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-declaration-merging': error
'@typescript-eslint/no-unsafe-member-access': off
'@typescript-eslint/no-unsafe-return': off
'@typescript-eslint/no-useless-empty-export': error
'@typescript-eslint/non-nullable-type-assertion-style': error
'@typescript-eslint/prefer-enum-initializers': error
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/prefer-includes': error
'@typescript-eslint/prefer-literal-enum-member': error
'@typescript-eslint/prefer-nullish-coalescing': error
'@typescript-eslint/prefer-optional-chain': error
'@typescript-eslint/prefer-regexp-exec': error
'@typescript-eslint/prefer-return-this-type': error
'@typescript-eslint/prefer-string-starts-ends-with': error
'@typescript-eslint/prefer-ts-expect-error': off
'@typescript-eslint/ban-ts-comment': off
'@typescript-eslint/promise-function-async': error
'@typescript-eslint/require-array-sort-compare': error
'@typescript-eslint/restrict-plus-operands': error
'@typescript-eslint/restrict-template-expressions': error
'@typescript-eslint/strict-boolean-expressions': off
'@typescript-eslint/switch-exhaustiveness-check': error
'@typescript-eslint/type-annotation-spacing':
- error
- after: true
before: false
overrides:
arrow:
before: true
after: true
'@typescript-eslint/unified-signatures': error
'@typescript-eslint/block-spacing': error
'@typescript-eslint/brace-style': error
'@typescript-eslint/comma-dangle': error
'@typescript-eslint/comma-spacing': error
'@typescript-eslint/default-param-last': error
'@typescript-eslint/dot-notation': error
'@typescript-eslint/func-call-spacing': error
'@typescript-eslint/indent':
- error
- 4
- VariableDeclarator: first
MemberExpression: 1
FunctionDeclaration:
body: 1
parameters: 1
FunctionExpression:
body: 1
parameters: 1
CallExpression:
arguments: 1
ArrayExpression: 1
ObjectExpression: 1
ImportDeclaration: 1
flatTernaryExpressions: false
'@typescript-eslint/key-spacing':
- off
- afterColon: true
mode: strict
align: colon
'@typescript-eslint/keyword-spacing':
- error
- before: true
after: true
overrides:
if:
after: false
for:
after: false
while:
after: false
'@typescript-eslint/lines-around-comment': off
'@typescript-eslint/lines-between-class-members':
- error
- always
'@typescript-eslint/no-dupe-class-members': error
'@typescript-eslint/no-empty-function': error
'@typescript-eslint/no-extra-parens':
- error
- all
- ignoreJSX: all
'@typescript-eslint/no-extra-semi': error
'@typescript-eslint/no-implied-eval': error
'@typescript-eslint/no-invalid-this': error
'@typescript-eslint/no-loop-func': error
'@typescript-eslint/no-loss-of-precision': error
'@typescript-eslint/no-redeclare': error
'@typescript-eslint/no-restricted-imports': error
'@typescript-eslint/no-shadow': error
'@typescript-eslint/no-throw-literal': error
'@typescript-eslint/no-unused-expressions': error
'@typescript-eslint/no-unused-vars': error
'@typescript-eslint/no-use-before-define': error
'@typescript-eslint/no-useless-constructor': error
'@typescript-eslint/require-await': error
'@typescript-eslint/return-await': error
'@typescript-eslint/semi': error
'@typescript-eslint/space-before-blocks': error
'@typescript-eslint/space-infix-ops': error
'@typescript-eslint/space-before-function-paren':
- error
- asyncArrow: always
named: never
'@typescript-eslint/quotes':
- error
- single
- avoidEscape: true
'@typescript-eslint/object-curly-spacing':
- error
- always
- arraysInObjects: false
objectsInObjects: true
'@typescript-eslint/padding-line-between-statements':
- error
- blankLine: always
prev: '*'
next:
- interface
- type
- blankLine: always
prev: '*'
next: return
- blankLine: always
prev: '*'
next:
- export
- blankLine: any
prev: export
next: export
- blankLine: always
prev: '*'
next: expression
- blankLine: always
prev: import
next: '*'
- blankLine: any
prev: import
next: import
- blankLine: always
prev: '*'
next: block-like