forked from aws/aws-toolkit-vscode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tslint.yaml
162 lines (159 loc) · 4.48 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
---
extends:
- tslint-eslint-rules
- tslint-no-circular-imports
linterOptions:
exclude:
- node_modules/**
- '**/*.json'
rules:
# TypeScript-specific
# These rules find errors related to TypeScript features:
adjacent-overload-signatures: true
member-access:
options:
- check-constructor
member-ordering:
options:
- order: instance-sandwich
no-reference: true
no-var-requires: true
prefer-for-of: true
promise-function-async: true
# Functionality
# These rules catch common errors in JS programming or otherwise confusing constructs that are prone to producing bugs:
await-promise:
options:
- Thenable
ban-comma-operator: true
curly: true
forin: true
label-position: true
no-arg: true
no-bitwise: true
no-conditional-assignment: true
# TODO: Enable no-console once we have a logging framework in place.
# no-console: true
no-construct: true
no-debugger: true
no-duplicate-super: true
no-duplicate-switch-case: true
no-duplicate-variable: true
no-dynamic-delete: true
no-eval: true
no-floating-promises: true
no-for-in-array: true
no-implicit-dependencies:
options:
- - vscode
- semver-regex
- del
- sinon
no-inferred-empty-object-type: true
no-invalid-template-strings: true
no-invalid-this:
options:
- check-function-in-method
no-misused-new: true
no-null-keyword: true
no-object-literal-type-assertion: true
no-shadowed-variable: true
no-sparse-arrays: true
no-string-literal: true
no-string-throw: true
no-switch-case-fall-through: true
no-this-assignment:
options:
- allow-destructuring
no-unbound-method:
options:
- ignore-static
no-unsafe-any: true
no-unsafe-finally: true
no-unused-expression: true
no-var-keyword: true
no-void-expression:
options:
- ignore-arrow-function-shorthand
prefer-object-spread: true
radix: true
restrict-plus-operands: true
triple-equals: true
use-isnan: true
# Maintainability
# These rules make code maintenance easier:
cyclomatic-complexity: true
deprecation: true
eofline: true
indent:
options:
- spaces
- 4
no-duplicate-imports: true
prefer-const: true
prefer-readonly: true
trailing-comma: true
# This now allows dates with formats similar to the below:
# 2018
# 2018-2019
# 2018, 2020
# 2018-2020, 2022
# 2018-2020, 2022-2023
# etc.
file-header:
options:
- "Copyright ([0-9]{4}[-,]{0,1}[ ]{0,1}){1,} Amazon.com, Inc. or its affiliates. All Rights Reserved.\\r?\\n \\* SPDX-License-Identifier: Apache-2.0"
- "Copyright \\d{4} Amazon.com, Inc. or its affiliates. All Rights Reserved.\\r?\\n \\* SPDX-License-Identifier: Apache-2.0"
- "Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: Apache-2.0"
file-name-casing:
options:
- camel-case
interface-name:
options:
- never-prefix
interface-over-type-literal: true
jsdoc-format: true
newline-before-return: true
new-parens: true
no-boolean-literal-compare: true
no-consecutive-blank-lines: true
no-trailing-whitespace: true
no-unnecessary-callback-wrapper: true
no-unnecessary-initializer: true
no-unnecessary-qualifier: true
number-literal-format: true
object-literal-key-quotes:
options:
- as-needed
one-line:
options:
- check-catch
- check-finally
- check-else
- check-open-brace
- check-whitespace
one-variable-per-declaration: true
ordered-imports: true
prefer-method-signature: true
prefer-switch: true
prefer-template:
options:
- allow-single-concat
prefer-while: true
quotemark:
options:
- single
- avoid-template
- avoid-escape
switch-final-break:
options:
- always
variable-name:
options:
- check-format
- allow-leading-underscore
- ban-keywords
# ESLint
# The following rules are provided by ESLint via the tslint-eslint-rules package.
no-unexpected-multiline: true
defaultSeverity: error