Skip to content

Commit c064040

Browse files
committed
chore: optimize tslint config
1 parent ad857aa commit c064040

File tree

5 files changed

+23
-31
lines changed

5 files changed

+23
-31
lines changed

Diff for: src/leetCodeManager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ class LeetCodeManager extends EventEmitter {
186186
} else if (data.match(this.failRegex)) {
187187
childProc.stdin?.end();
188188
return reject(new Error("Faile to login"));
189-
} else if (data.match(/login: /)){
189+
} else if (data.match(/login: /)) {
190190
childProc.stdin?.write(`${name}\n`);
191-
} else if (data.match(/cookie: /)){
191+
} else if (data.match(/cookie: /)) {
192192
childProc.stdin?.write(`${cookie}\n`);
193193
}
194194
});

Diff for: src/utils/httpUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function LcAxios<T = any>(path: string, settings?: AxiosRequestConfig): A
1616
}
1717
return axios(path, {
1818
headers: {
19-
referer: referer,
19+
referer,
2020
"content-type": "application/json",
2121
cookie,
2222
...(settings && settings.headers),

Diff for: src/utils/toolUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function parseQuery(query: string): { [key: string]: string } {
99
return queryObject;
1010
}
1111

12-
let keyValuePairs = query.split("&");
12+
const keyValuePairs = query.split("&");
1313
keyValuePairs.forEach((pair) => {
1414
const firstEqualsIndex = pair.indexOf("=");
1515
if (firstEqualsIndex !== -1) {

Diff for: src/utils/trackingUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class TrackData implements ITrackData {
9090
if (!Array.isArray(reportItems)) {
9191
reportItems = [reportItems];
9292
}
93-
let randomId = getRandomString(60);
93+
const randomId = getRandomString(60);
9494
reportItems.forEach((item) => {
9595
this.reportCache.push({
9696
...item,

Diff for: tslint.json

+18-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
11
{
22
"defaultSeverity": "error",
3-
"extends": [
4-
"tslint:recommended"
5-
],
3+
"extends": ["tslint:recommended"],
64
"jsRules": {},
75
"rules": {
8-
"forin": false,
96
"object-literal-sort-keys": false,
10-
"indent": [
11-
true,
12-
"spaces"
13-
],
7+
"ordered-imports": [false],
8+
"indent": [true, "spaces"],
149
"no-string-literal": false,
1510
"no-namespace": false,
16-
"max-line-length": [
17-
false,
18-
120
19-
],
20-
"typedef": [
21-
true,
22-
"call-signature",
23-
"arrow-call-signature",
24-
"parameter",
25-
"arrow-parameter",
26-
"property-declaration",
27-
"variable-declaration",
28-
"member-variable-declaration"
29-
],
30-
"variable-name": [
31-
true,
32-
"allow-leading-underscore"
33-
]
11+
"max-line-length": [false, 120],
12+
"typedef": false,
13+
"no-implicit-dependencies": [true, ["vscode"]],
14+
"trailing-comma": false,
15+
"no-any": false,
16+
"object-literal-key-quotes": [true, "consistent-as-needed"],
17+
"prefer-object-spread": false,
18+
"no-unnecessary-await": false,
19+
"semicolon": [false],
20+
"quotemark": [false],
21+
"member-ordering": [false],
22+
"variable-name": [false],
23+
"curly": false,
24+
"interface-over-type-literal": [false],
25+
"no-unused-expression": false
3426
},
3527
"rulesDirectory": []
3628
}

0 commit comments

Comments
 (0)