-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
240 lines (240 loc) · 9.17 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
env:
es2022: true
extends:
- eslint:recommended
- airbnb-base
- plugin:import/recommended
- plugin:import/typescript
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:@typescript-eslint/strict
- prettier
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.json
sourceType: module
plugins: [simple-import-sort, typescript-sort-keys]
root: true
ignorePatterns: [bin/forks/*/package, build, local]
rules:
class-methods-use-this: off
complexity: [error, {max: 10}]
consistent-return: off
curly: [error, all]
default-param-last: off
dot-notation: off
import/exports-last: error
import/extensions: [error, never]
import/named: error
import/no-commonjs: error
import/no-default-export: error
import/no-deprecated: error
import/no-duplicates: [error, {prefer-inline: true}]
import/no-extraneous-dependencies: [error, {devDependencies: false, packageDir: [., ./autotests]}]
import/no-internal-modules:
- error
- allow:
- '**/constants/internal'
- '**/context/*'
- '**/e2ed/*'
- '**/generators/internal'
- '**/selectors/internal'
- '**/types/customPackProperties'
- '**/types/internal'
- '**/types/skipTests'
- '**/utils/*'
import/no-nodejs-modules:
- error
- allow:
- node:async_hooks
- node:child_process
- node:crypto
- node:fs
- node:fs/promises
- node:http
- node:https
- node:module
- node:os
- node:path
- node:perf_hooks
- node:querystring
- node:stream
- node:url
- node:util
import/no-relative-packages: off
import/no-restricted-paths:
- error
- zones:
- target: './src/!(constants)/**/*'
from: ./src/constants
except: [./internal.ts]
- target: './src/!(types)/**/*'
from: ./src/types
except: [./internal.ts]
import/no-unassigned-import: error
import/no-unresolved:
- error
- {commonjs: true, ignore: [autotests, e2ed/testcafe]}
import/no-unused-modules:
- error
- ignoreExports:
- autotests/**/index.ts
- autotests/context/pageCookies.ts
- autotests/packs/*
- autotests/tests/**
- autotests/types/*
- scripts/*.ts
- src/*/index.ts
- src/*/internal.ts
- src/bin/*.ts
- src/config.ts
- src/createLocator.ts
- src/getModulesGraph.ts
- src/globby.ts
- src/index.ts
missingExports: true
unusedExports: true
import/no-useless-path-segments: [error, {commonjs: true, noUselessIndex: true}]
import/order: off
import/prefer-default-export: off
import/unambiguous: error
no-await-in-loop: off
no-continue: off
no-empty: [error, {allowEmptyCatch: true}]
no-loop-func: off
no-magic-numbers: off
no-restricted-syntax:
- error
- ExportAllDeclaration
- ':not(MethodDefinition, Property) > FunctionExpression'
no-return-await: off
no-shadow: off
no-underscore-dangle: [error, {allow: [_onConfigureResponse]}]
no-unused-expressions: off
no-useless-constructor: off
no-use-before-define: off
no-void: off
max-depth: [error, {max: 3}]
max-lines: [error, {max: 120, skipBlankLines: true, skipComments: true}]
max-lines-per-function: [error, {IIFEs: true, max: 100, skipBlankLines: true, skipComments: true}]
max-params: off
max-statements: [error, {max: 25}]
padding-line-between-statements:
- error
- {blankLine: always, prev: class, next: '*'}
- {blankLine: always, prev: '*', next: class}
- {blankLine: always, prev: [const, let], next: '*'}
- {blankLine: always, prev: '*', next: [const, let]}
- {blankLine: any, prev: [const, let], next: [const, let]}
- {blankLine: always, prev: block-like, next: '*'}
- {blankLine: always, prev: '*', next: block-like}
- {blankLine: always, prev: '*', next: return}
- {blankLine: always, prev: throw, next: '*'}
- {blankLine: always, prev: '*', next: throw}
prefer-destructuring: off
simple-import-sort/exports: error
simple-import-sort/imports:
- error
- groups:
- ['^node:']
- ['^\w']
- ['^\u0000']
- ['^\.\./\.\./\.\./\.\./\.\./\.\./\.\.(?!/?$)', '^\.\./\.\./\.\./\.\./\.\./?$']
- ['^\.\./\.\./\.\./\.\./\.\./\.\.(?!/?$)', '^\.\./\.\./\.\./\.\./?$']
- ['^\.\./\.\./\.\./\.\.(?!/?$)', '^\.\./\.\./\.\./\.\./?$']
- ['^\.\./\.\./\.\.(?!/?$)', '^\.\./\.\./\.\./?$']
- ['^\.\./\.\.(?!/?$)', '^\.\./\.\./?$']
- ['^\.\.(?!/?$)', '^\.\./?$']
- ['^\./(?=.*/)(?!/?$)', '^\.(?!/?$)', '^\./?$']
- ['^\w.*\u0000$']
- ['^[^.].*\u0000$']
- ['^\.\./\.\./\.\./\.\./\.\./\.\./.*\u0000$']
- ['^\.\./\.\./\.\./\.\./\.\./.*\u0000$']
- ['^\.\./\.\./\.\./\.\./.*\u0000$']
- ['^\.\./\.\./\.\./.*\u0000$']
- ['^\.\./\.\./.*\u0000$']
- ['^\.\./.*\u0000$']
- ['^\..*\u0000$']
sort-keys: [error, asc, {caseSensitive: true, natural: false}]
typescript-sort-keys/string-enum: error
'@typescript-eslint/adjacent-overload-signatures': error
'@typescript-eslint/array-type': error
'@typescript-eslint/ban-types': [error, {extendDefaults: true, types: {'{}': false}}]
'@typescript-eslint/class-literal-property-style': error
'@typescript-eslint/consistent-generic-constructors': error
'@typescript-eslint/consistent-indexed-object-style': error
'@typescript-eslint/consistent-return': off
'@typescript-eslint/consistent-type-assertions':
[error, {assertionStyle: as, objectLiteralTypeAssertions: never}]
'@typescript-eslint/consistent-type-definitions': [error, type]
'@typescript-eslint/consistent-type-exports': error
'@typescript-eslint/consistent-type-imports': [error, {disallowTypeAnnotations: false}]
'@typescript-eslint/default-param-last': error
'@typescript-eslint/dot-notation': error
'@typescript-eslint/explicit-function-return-type': [error, {allowExpressions: true}]
'@typescript-eslint/explicit-member-accessibility': [error, {accessibility: no-public}]
'@typescript-eslint/explicit-module-boundary-types': error
'@typescript-eslint/max-params': [error, {max: 3}]
'@typescript-eslint/member-ordering': [error, {default: {order: alphabetically}}]
'@typescript-eslint/method-signature-style': error
'@typescript-eslint/naming-convention':
- error
- {selector: default, format: [strictCamelCase, StrictPascalCase], leadingUnderscore: allow}
- selector: variable
format: [strictCamelCase, StrictPascalCase, UPPER_CASE]
leadingUnderscore: allow
- {selector: typeLike, format: [StrictPascalCase]}
- {selector: [objectLiteralProperty, typeProperty], format: null, modifiers: [requiresQuotes]}
- {selector: [classProperty, typeMethod], filter: '^toJSON$', format: null}
'@typescript-eslint/no-import-type-side-effects': error
'@typescript-eslint/no-inferrable-types': off
'@typescript-eslint/no-invalid-void-type':
[error, {allowInGenericTypeArguments: true, allowAsThisParameter: true}]
'@typescript-eslint/no-loop-func': error
'@typescript-eslint/no-magic-numbers':
- error
- ignore: [-1, 0, 1, 2, 1024]
ignoreArrayIndexes: true
ignoreDefaultValues: true
ignoreEnums: true
ignoreNumericLiteralTypes: true
ignoreReadonlyClassProperties: true
ignoreTypeIndexes: true
'@typescript-eslint/no-namespace': [error, {allowDeclarations: true}]
'@typescript-eslint/no-shadow': error
'@typescript-eslint/no-unnecessary-boolean-literal-compare': off
'@typescript-eslint/no-unnecessary-qualifier': error
'@typescript-eslint/no-unsafe-unary-minus': error
'@typescript-eslint/no-use-before-define': error
'@typescript-eslint/no-unused-expressions': error
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: ^_
caughtErrors: all
caughtErrorsIgnorePattern: ^_
destructuredArrayIgnorePattern: ^_
ignoreRestSiblings: true
varsIgnorePattern: ^_
'@typescript-eslint/no-useless-empty-export': error
'@typescript-eslint/parameter-properties': error
'@typescript-eslint/prefer-destructuring':
[error, {VariableDeclarator: {array: false, object: true}}]
'@typescript-eslint/prefer-enum-initializers': error
'@typescript-eslint/prefer-find': error
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/prefer-namespace-keyword': error
'@typescript-eslint/prefer-nullish-coalescing': error
'@typescript-eslint/prefer-optional-chain': error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/quotes': [error, single, {avoidEscape: true}]
'@typescript-eslint/require-array-sort-compare': error
'@typescript-eslint/return-await': [error, never]
'@typescript-eslint/sort-type-constituents': [error, {checkIntersections: false}]
'@typescript-eslint/strict-boolean-expressions': [error, {allowNullableBoolean: true}]
'@typescript-eslint/switch-exhaustiveness-check':
[error, {allowDefaultCaseForExhaustiveSwitch: false, requireDefaultForNonUnion: true}]
'@typescript-eslint/typedef': error
settings:
import/extensions: [.ts]
import/resolver: {node: {extensions: [.ts]}}