This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
320 lines (312 loc) · 8.03 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
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
root: true
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.eslint.json
plugins:
- '@typescript-eslint'
- jest
- import
extends:
- 'eslint:all'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
- 'plugin:jest/all'
- 'plugin:import/typescript'
rules:
import/group-exports: warn
import/no-anonymous-default-export:
- error
- allowObject: true
import/no-named-default: error
import/no-unassigned-import:
- error
- allow:
- reflect-metadata
import/export: error
import/prefer-default-export: warn
import/default: off
import/exports-last: error
import/no-duplicates: error
import/no-extraneous-dependencies: error
import/no-named-as-default-member: error
import/extensions:
- error
- never
- json: always
import/no-unresolved: error
import/no-absolute-path: error
import/no-dynamic-require: error
import/no-amd: error
import/no-mutable-exports: error
import/no-commonjs: error
import/no-self-import: error
import/no-named-as-default: error
# import/no-relative-parent-imports: error
import/no-useless-path-segments:
- error
- noUselessIndex: true
commonjs: true
jest/no-hooks: off
# prettier reformats the whole file, I would have to disable my linter for tests and reformat every test
jest/prefer-inline-snapshots: off
jest/no-disabled-tests: off
# we need this for module augmentation
jest/no-jest-import: off
'@typescript-eslint/array-type':
- warn
- default: array-simple
# in vast majority of cases 'this' is only used in classes so I'd
# rather save myself some boilerplate
'@typescript-eslint/unbound-method': off
'@typescript-eslint/consistent-type-definitions': 1
'@typescript-eslint/default-param-last': error
'@typescript-eslint/explicit-function-return-type': 0
'@typescript-eslint/explicit-member-accessibility': 0
'@typescript-eslint/member-delimiter-style': 'off'
'@typescript-eslint/naming-convention':
- warn
- format:
- PascalCase
prefix:
- is
- should
- has
- can
- did
- will
selector: variable
types:
- boolean
- format:
- PascalCase
- camelCase
selector: variable
types:
- function
- format:
- UPPER_CASE
selector: enumMember
- format:
- camelCase
- PascalCase
selector: function
- format:
- camelCase
- PascalCase
- UPPER_CASE
selector: default
- format:
- camelCase
- UPPER_CASE
- PascalCase
selector: variable
- format:
- camelCase
leadingUnderscore: allow
selector: parameter
- format:
- camelCase
leadingUnderscore: require
modifiers:
- private
selector: memberLike
- format:
- PascalCase
selector: typeLike
'@typescript-eslint/no-dynamic-delete': 1
'@typescript-eslint/no-empty-function':
- warn
- allow:
- protected-constructors
- private-constructors
'@typescript-eslint/no-extra-non-null-assertion': error
'@typescript-eslint/no-extraneous-class': warn
'@typescript-eslint/no-floating-promises':
- error
- ignoreVoid: true
'@typescript-eslint/no-implied-eval': error
'@typescript-eslint/no-inferrable-types': warn
'@typescript-eslint/no-non-null-asserted-optional-chain': error
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-throw-literal': error
'@typescript-eslint/no-unnecessary-condition':
- warn
- ignoreRhs: true
'@typescript-eslint/no-unnecessary-qualifier': error
'@typescript-eslint/no-unnecessary-type-arguments': warn
'@typescript-eslint/no-unused-expressions': warn
'@typescript-eslint/no-unused-vars':
- warn
- argsIgnorePattern: returns|type
args: none
'@typescript-eslint/no-use-before-define': 'off'
'@typescript-eslint/no-useless-constructor': error
'@typescript-eslint/prefer-for-of': warn
'@typescript-eslint/prefer-function-type': warn
'@typescript-eslint/prefer-nullish-coalescing':
- warn
- forceSuggestionFixer: true
'@typescript-eslint/prefer-optional-chain': error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/promise-function-async': error
'@typescript-eslint/require-array-sort-compare': error
'@typescript-eslint/require-await': error
'@typescript-eslint/restrict-plus-operands':
- error
- checkCompoundAssignments: true
'@typescript-eslint/restrict-template-expressions':
- off
- allowNumber: true
'@typescript-eslint/return-await': error
# Good idea probably, but it's just not worth it, especially wheh
# cases are covered by tests.
'@typescript-eslint/strict-boolean-expressions': off
# - warn
# - allowNullable: true
# allowSafe: true
# ignoreRhs: true
'@typescript-eslint/unified-signatures': off
array-element-newline: 'off'
arrow-body-style: warn
arrow-parens: 'off'
array-bracket-newline: off
brace-style: 'off'
callback-return: 'off'
capitalized-comments: 'off'
class-methods-use-this: 'off'
comma-dangle: 'off'
curly: 'off'
default-param-last: 'off'
dot-location: 'off'
eol-last: 'off'
func-call-spacing: 'off'
func-names:
- warn
- as-needed
func-style: 'off'
function-call-argument-newline: 'off'
function-paren-newline: 'off'
id-length:
- warn
- exceptions:
- x
- _
- e
- i
- R
implicit-arrow-linebreak: 'off'
indent: 'off'
init-declarations: 'off'
key-spacing: 'off'
line-comment-position: warn
linebreak-style: 'off'
lines-around-comment: 'off'
lines-between-class-members: 'off'
max-classes-per-file: 'off'
max-len:
- warn
- code: 150
ignorePattern: ^import
ignoreUrls: true
tabWidth: 2
max-lines-per-function: 'off'
max-params:
- warn
- max: 5
max-statements:
- warn
- max: 20
multiline-comment-style: 'off'
multiline-ternary:
- warn
- always-multiline
new-cap:
- warn
- capIsNew: false
new-parens: 'off'
newline-per-chained-call: 'off'
no-await-in-loop: warn
no-confusing-arrow: 'off'
no-console: 'off'
no-constant-condition: 'off'
no-else-return: warn
no-extra-boolean-cast: 'off'
no-extra-parens: 'off'
no-extra-semi: 'off'
no-implicit-coercion:
- error
- allow:
- '!!'
no-import-assign: warn
no-inline-comments: warn
no-magic-numbers: 'off'
no-mixed-spaces-and-tabs:
- warn
- smart-tabs
no-multi-spaces: 'off'
no-multiple-empty-lines: 'off'
no-nested-ternary: 'off'
no-plusplus: warn
no-process-env: 'off'
no-return-await: 'off'
no-shadow:
- warn
- builtinGlobals: true
no-sync: 'off'
no-tabs: 'off'
no-ternary: 'off'
no-trailing-spaces: 'off'
no-undefined: 'off'
no-underscore-dangle: 'off'
no-unused-expressions: 'off'
no-unused-vars: 'off'
no-useless-constructor: 'off'
no-useless-rename: 'off'
no-warning-comments: warn
nonblock-statement-body-position: 'off'
object-curly-spacing: 'off'
object-curly-newline: off
object-property-newline: 'off'
object-shorthand: 'off'
one-var: 'off'
operator-linebreak: warn
padded-blocks: 'off'
prefer-const: warn
prefer-template: warn
quote-props: 'off'
quotes: 'off'
require-atomic-updates: warn
require-await: 'off'
semi: 'off'
sort-imports: 'off'
sort-keys: 'off'
sort-vars: 'off'
space-before-blocks: 'off'
space-before-function-paren: 'off'
space-in-parens: 'off'
space-infix-ops: 'off'
spaced-comment: 'off'
template-curly-spacing: 'off'
overrides:
- files:
- '*.d.ts'
rules:
'@typescript-eslint/no-unused-vars': 'off'
- files:
- '*.spec.ts'
rules:
'@typescript-eslint/require-await': 'off'
init-declarations: 'off'
settings:
import/extensions:
- ts
import/parsers:
'@typescript-eslint/parser':
- .ts
- .tsx
import/resolver:
typescript:
alwaysTryTypes: true
env:
jest/globals: true