forked from signalapp/Signal-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtslint.json
More file actions
202 lines (176 loc) · 5.82 KB
/
Copy pathtslint.json
File metadata and controls
202 lines (176 loc) · 5.82 KB
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
{
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-react", "tslint-microsoft-contrib"],
"jsRules": {},
"rules": {
// prettier is handling this
"align": false,
"newline-per-chained-call": false,
"array-type": [true, "generic"],
"number-literal-format": false,
// Preferred by Prettier:
"arrow-parens": [true, "ban-single-arg-parens"],
// Breaks when we use .extend() to create a Backbone subclass
"no-invalid-this": false,
"import-spacing": false,
"indent": [true, "spaces", 2],
"interface-name": [true, "never-prefix"],
"member-access": false,
"member-ordering": false,
"newline-before-return": false,
"prefer-for-of": false,
"no-this-assignment": false,
"binary-expression-operand-order": false,
"no-backbone-get-set-outside-model": false,
// Allows us to write inline `style`s. Revisit when we have a more sophisticated
// CSS-in-JS solution:
"jsx-no-multiline-js": false,
// We'll make tradeoffs where appropriate
"jsx-no-lambda": false,
"react-this-binding-issue": false,
"linebreak-style": [true, "LF"],
// Prettier handles this for us
"max-line-length": false,
"mocha-avoid-only": true,
// Disabled until we can allow dynamically generated tests:
// https://github.com/Microsoft/tslint-microsoft-contrib/issues/85#issuecomment-371749352
"mocha-no-side-effect-code": false,
"mocha-unneeded-done": true,
// We always want 'as Type'
"no-angle-bracket-type-assertion": true,
// mostly always a false positive
"no-backbone-get-set-outside-model": false,
"no-consecutive-blank-lines": [true, 2],
"object-literal-key-quotes": [true, "as-needed"],
"object-literal-sort-keys": false,
// Ignore import sources order until we can specify that we want ordering
// based on import name vs module name:
"ordered-imports": [
true,
{
"import-sources-order": "any",
"named-imports-order": "case-insensitive-legacy"
}
],
"quotemark": [
true,
"single",
"jsx-double",
"avoid-template",
"avoid-escape"
],
// Preferred by Prettier:
"semicolon": [true, "always", "ignore-bound-class-methods"],
// Preferred by Prettier:
"trailing-comma": [
true,
{
"singleline": "never",
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "never",
"typeLiterals": "always"
},
"esSpecCompliant": true
}
],
// Crashing!
"use-default-type-parameter": false,
// Disabling a large set of Microsoft-recommended rules
// Modifying:
// React components and namespaces are Pascal case
"variable-name": [true, "allow-pascal-case"],
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"function-name": [
true,
{
"function-regex": "^_?[A-Za-z][\\w\\d]+$",
"method-regex": "^_?[a-z][\\w\\d]+$",
"static-method-regex": "^_?[a-z][\\w\\d]+$"
}
],
// Adding select dev dependencies here for now, may turn on all in the future
"no-implicit-dependencies": [
true,
[
"dashdash",
"electron",
"@storybook/react",
"@storybook/addon-actions",
"@storybook/addon-knobs"
]
],
// So things like "autoplay" on <video> work
"jsx-boolean-value": false,
// Maybe will turn on:
// We're not trying to be comprehensive with JSDoc right now. We have the style guide.
"completed-docs": false,
// Today we have files with a single named export which isn't the filename. Eventually.
"export-name": false,
// We have a lot of 'any' in our code today
"no-any": false,
// We use this today, could get rid of it
"no-increment-decrement": false,
// This seems to detect false positives: any multi-level object literal, for example
"no-object-literal-type-assertion": false,
// I like relative references to the current dir, or absolute. Maybe can do this?
"no-relative-imports": false,
// We have a lot of 'any' in our code today
"no-unsafe-any": false,
// Not everything needs to be typed right now
"typedef": false,
// Probably won't turn on:
"possible-timing-attack": false,
// We use null
"no-null-keyword": false,
// We want to import a capitalized React, for example
"import-name": false,
// We have the styleguide for better docs
"missing-jsdoc": false,
// 'type' and 'number' are just too common
"no-reserved-keywords": false,
// The style guide needs JSDoc-style block comments to extract proptype documentation
"no-single-line-block-comment": false,
// Out-of-order functions can improve readability
"no-use-before-declare": false,
// We use Array<type> syntax
"prefer-array-literal": false,
// We prefer key: () => void syntax, because it suggests an object instead of a class
"prefer-method-signature": false,
// 'as' is nicer than angle brackets.
"prefer-type-cast": false,
// We use || and && shortcutting because we're javascript programmers
"strict-boolean-expressions": false
},
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
"linterOptions": {
"exclude": [
"sticker-creator/**/*.ts",
"sticker-creator/**/*.tsx",
"ts/*.ts",
"ts/backbone/**",
"ts/build/**",
"ts/components/*.ts[x]",
"ts/components/conversation/**",
"ts/components/emoji/**",
"ts/components/stickers/**",
"ts/notifications/**",
"ts/protobuf/**",
"ts/scripts/**",
"ts/services/**",
"ts/shims/**",
"ts/state/**",
"ts/storybook/**",
"ts/test/**",
"ts/types/**",
"ts/updater/**",
"ts/util/**"
]
}
}