This repository has been archived by the owner on May 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtslint.yaml
201 lines (193 loc) · 5.17 KB
/
tslint.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
---
extends:
- tslint:latest
- tslint-eslint-rules
- tslint-consistent-codestyle
- tslint-no-unused-expression-chai
- tslint-sonarts
- tslint-strict-error-throw
rules:
# --------------------------------------
# Rules from tslint-consistent-codestyle
# --------------------------------------
naming-convention:
severity: warning # change to error later
options:
- type: default
format: strictCamelCase
leadingUnderscore: forbid
trailingUnderscore: forbid
- type: variable
modifiers:
- const
format:
- strictCamelCase
- UPPER_CASE
- type: functionVariable
modifiers:
- const
format: strictCamelCase
- type: parameter
modifiers: unused
leadingUnderscore: allow
- type: method
filter: "^toJSON$"
format:
- type: property
modifiers:
- public
- static
- const
format: UPPER_CASE
- type: member
leadingUnderscore: allow
- type: type
format: StrictPascalCase
- type: enumMember
format:
- StrictPascalCase
- UPPER_CASE
no-collapsible-if: true
no-static-this: true
no-unused: true
no-var-before-return: true
prefer-const-enum: true
prefer-while: true
# --------------------------------------
# TSLint rules
# --------------------------------------
arrow-return-shorthand: true
await-promise:
options:
- Bluebird
- PromiseLike
ban:
severity: warning
options:
- name:
- chai
- assert
message: Use 'expect' rather then 'assert'
cyclomatic-complexity: false # use cognitive-complexity
deprecation:
severity: warning
interface-name: false
max-classes-per-file: false
max-file-line-count:
options:
- 500
member-access: false
no-angle-bracket-type-assertion: false
no-floating-promises: true
no-for-in-array: true
no-invalid-this: true
no-irregular-whitespace: true
no-null-keyword: true
no-parameter-reassignment:
severity: warning # change to error later
no-require-imports: true
no-submodule-imports:
options:
- lodash
- "@ses/database"
no-switch-case-fall-through: true
no-unnecessary-callback-wrapper: true
no-unnecessary-class: true
no-unsafe-any:
severity: warning # change to error later
no-unused-expression: false # already use no-unused-expression-chai
no-var-requires: false # already use no-require-imports
object-literal-sort-keys: false
ordered-imports: false
prefer-const: true
prefer-readonly: true
quotemark:
options:
- single
radix: false # not common mistake: default 10 is the most common case
trailing-comma:
options:
- multiline:
- arrays: always
- objects: always
- singleline: never
typedef:
options:
- call-signature
variable-name:
options:
- ban-keywords
- check-format
- allow-leading-underscore
whitespace:
options:
- check-branch
- check-decl
- check-operator
- check-module
- check-separator
- check-rest-spread
- check-type
- check-type-operator
- check-preblock
# --------------------------------------
# Rules from tslint-eslint-rules
# --------------------------------------
handle-callback-err:
options:
- "^(err|error|anySpecificError)$"
no-control-regex: true
no-duplicate-case: true
no-empty-character-class: true
no-ex-assign: true
no-extra-boolean-cast: true
no-extra-semi: false # not common mistake
no-implicit-dependencies:
options:
- optional
- dev
no-inner-declarations:
options:
- functions
no-invalid-regexp: true
no-regex-spaces: true
no-unexpected-multiline: true
ter-no-self-compare: true
valid-typeof: true
# Below rules are not implemented in tslint-eslint-rules yet:
#
# // "max-depth": [ true, 5 ],
# // "max-statements": [true, 10, {"ignoreTopLevelFunctions": true}],
# // "no-path-concat": true,
# // "no-warning-comments": true,
# // "prefer-template": true,
# // "no-param-reassign": [true, {
# // "props": false
# // }],
# --------------------------------------
# Rules from tslint-sonarts
# --------------------------------------
cognitive-complexity:
severity: error
options:
- 40 # target: 15
no-big-function:
severity: error
options:
- 120
no-commented-code:
severity: error
no-duplicate-string: false # In some cases, string is more readable then constant variable
no-hardcoded-credentials: false
no-identical-functions:
severity: warning
no-invalid-await: false # use await-promise
no-redundant-boolean: false
no-small-switch: false
parameters-max-number:
severity: warning # change to error later
# --------------------------------------
# Rules from tslint-strict-error-throw
# --------------------------------------
strict-error-throw:
severity: warning # change to error later