This repository has been archived by the owner on May 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tslint.json
285 lines (285 loc) · 7.75 KB
/
tslint.json
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
{
"extends": [
// TSLINT: https://palantir.github.io/tslint/rules/
"tslint-eslint-rules",
"tslint-microsoft-contrib",
"tslint-react",
"tslint-react-hooks",
"tslint-no-unused-expression-chai"
],
"rulesDirectory": "dist",
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"array-bracket-spacing": [
true,
"never"
],
"array-type": [
true,
"array"
],
"arrow-parens": false,
"arrow-return-shorthand": [true],
"ban": [
true,
["alert"]
],
"binary-expression-operand-order": false, // reports lots of false positives
"brace-style": [
true,
"1tbs",
{
"allowSingleLine": false
}
],
"chai-vague-errors": false,
"class-name": true,
"cyclomatic-complexity": [
true,
9
],
"comment-format": [
true,
"check-space"
],
"completed-docs": false,
"consistent-return": false,
"curly": [true, "ignore-same-line"],
"eofline": true,
"export-name": false,
"file-name-casing": false, // it only allows to pick a single casing type, would break lot's of code bases
"forin": true,
"function-name": false,
"handle-callback-err": true,
"indent": [
true,
"spaces"
],
"interface-name": false,
"import-name": false,
//some overlap with no-multi-spaces but it also covers the missing space after import in
// import* as React from 'react';
"import-spacing": true,
"informative-docs": true, // since we do a breaking version, let's see what it finds might be disabled in next version
"insecure-random": false,
"jsdoc-format": false,
"jsx-alignment": false, //good for prod?
//jsx-ban-props:false,
"jsx-boolean-value": false,
"jsx-curly-spacing": ["never"],
"jsx-no-lambda": false, //is covered by react-this-binding-issue
"jsx-no-multiline-js": false,
"jsx-no-string-ref": true,
//jsx-use-translation-function:true //off by default,good for production
"jsx-self-close": true, //duplicate?
"jsx-wrap-multiline": true, // known issue https://github.com/palantir/tslint-react/issues/79
"label-position": true,
"match-default-export-name": false,
"max-classes-per-file": false,
"max-func-body-length": false,
"max-line-length": [
true,
100
],
"member-ordering": false,
"member-access": false,
"missing-jsdoc": false,
"new-parens": true,
"newline-before-return": false,
"newline-per-chained-call": false, // not going to introduce more formatting rules (go prettier or enable yourself)
"no-absolute-import-to-own-parent": true,
"no-angle-bracket-type-assertion": true,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-boolean-literal-compare": true,
"no-backbone-get-set-outside-model": false,
"no-consecutive-blank-lines": [
true,
3
],
"no-console": false,
"no-constant-condition": true,
"no-construct": true,
"no-control-regex": true,
"no-debugger": true,
"no-default-export": false,
"no-duplicate-variable": true,
"no-empty": true,
"no-empty-character-class": true,
"no-eval": true,
"no-ex-assign": true,
"no-extra-boolean-cast": true,
"no-extra-semi": false,
"no-http-string": false,
"no-increment-decrement": false,
"no-inferrable-types": true,
"no-inner-declarations": [
true,
"both"
],
"no-internal-module": true,
"no-invalid-regexp": true,
"no-irregular-whitespace": true,
"no-multi-spaces": true,
"no-multiline-string": false,
// "no-object-literal-type-assertion": false, // TODO: good candidate, but loooots of usages right now
"no-null-keyword": false,
"no-parameter-properties": false, // I like the idea, but most types are not ready for it
"no-regex-spaces": true,
"no-require-imports": false,
"no-relative-imports": false,
"no-reserved-keywords": false,
"no-shadowed-variable": false,
"no-single-line-block-comment": false,
"no-sparse-arrays": true,
// "no-submodule-imports": false, // disable in bm-toolbox?
"no-suspicious-comment": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-this-assignment": true,
"no-trailing-whitespace": true,
"no-unsafe-any": false,
"no-unnecessary-class": true,
"no-unnecessary-semicolons": false,
"no-unused-expression-chai": [ // "no-unused-expression" is disabled by extending config with the same name
true,
"allow-fast-null-checks",
"should"
],
"no-unused-variable": [
// in agreement with https://github.com/palantir/tslint/issues/4100
// this ruleset doesn't force people to switch to compile error
// for getting rid of unused things, this currently means
// paying the price of the deprecation warning
true
],
"no-use-before-declare": true,
"no-useless-files": true,
"no-void-expression": false,
"no-var-keyword": false,
"no-var-requires": true,
"object-curly-spacing": [
true,
"never"
],
"object-literal-key-quotes": [
true,
"as-needed"
],
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"one-variable-per-declaration": false,
"ordered-imports": false,
"prefer-const": true,
"prefer-method-signature": false,
"prefer-type-cast": false,
"quotemark": [
true,
"single",
"avoid-escape"
],
"radix": true,
"react-a11y-anchors": true,
"react-a11y-aria-unsupported-elements": true,
"react-a11y-event-has-role": true,
"react-a11y-image-button-has-alt": true,
"react-a11y-img-has-alt": true,
"react-a11y-lang": true,
"react-a11y-meta": true,
"react-a11y-no-onchange": false, // makes sense but might break to many things
"react-a11y-props": true,
"react-a11y-proptypes": true,
"react-a11y-role": true,
"react-a11y-role-has-required-aria-props": true,
"react-a11y-role-supports-aria-props": true,
"react-a11y-tabindex-no-positive": true,
"react-a11y-titles": true,
"react-anchor-blank-noopener": true,
"react-iframe-missing-sandbox": true,
"react-no-dangerous-html": true,
"react-this-binding-issue": true,
"react-unused-props-and-state": true,
"restrict-plus-operands": false,
"semicolon": [
true,
"always"
],
"space-before-function-paren": [
true,
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always",
"method": "never",
"constructor": "never"
}
],
"space-in-parens": [
true,
"never"
],
"strict-boolean-expressions": [
false,
"allow-null-union",
"allow-undefined-union"
],
"switch-default": true,
"ter-arrow-spacing": [
true
],
"ter-indent": [
true,
2,
{
"SwitchCase": true
}
],
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"triple-equals": true,
"typedef": false,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"use-isnan": true,
"use-simple-attributes": false, // might make sense, but as a general rule???
"valid-jsdoc": [
false,
{
"requireReturn": false
}
],
"valid-typeof": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}