Skip to content

Commit 865a6a0

Browse files
authored
Update tslint.json (#2)
Fixes warnings
1 parent c6c3cf6 commit 865a6a0

File tree

5 files changed

+37
-15
lines changed

5 files changed

+37
-15
lines changed

extension/src/apiprovider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CustomConfigurationProvider, SourceFileConfigurationItem, SourceFileCon
44
import * as vscode from "vscode";
55
import { GradleConfig, BinaryFind } from "./gradleconfig";
66

7-
function parseLanguage(args: string[], isCpp: boolean): string {
7+
function parseLanguage(_: string[], isCpp: boolean): string {
88
if (!isCpp) {
99
return 'c11';
1010
}
@@ -47,15 +47,15 @@ export class ApiProvider implements CustomConfigurationProvider {
4747

4848
public name: string = 'wpilib';
4949

50-
public async canProvideConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken | undefined): Promise<boolean> {
50+
public async canProvideConfiguration(uri: vscode.Uri, _?: vscode.CancellationToken | undefined): Promise<boolean> {
5151
const fileWp = vscode.workspace.getWorkspaceFolder(uri);
5252
if (fileWp === undefined || fileWp.index !== this.workspace.index) {
5353
return false;
5454
}
5555
const bins = await this.gradleConfig.findMatchingBinary([uri]);
5656
return bins.length !== 0;
5757
}
58-
public async provideConfigurations(uris: vscode.Uri[], token?: vscode.CancellationToken | undefined): Promise<SourceFileConfigurationItem[]> {
58+
public async provideConfigurations(uris: vscode.Uri[], _?: vscode.CancellationToken | undefined): Promise<SourceFileConfigurationItem[]> {
5959
const bins = await this.gradleConfig.findMatchingBinary(uris);
6060
const ret: SourceFileConfigurationItem[] = [];
6161
for (const b of bins) {

extension/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as vscode from 'vscode';
55
//import { GradleConfig } from './gradleconfig';
66
import { setExtensionContext } from './persistentState';
77
import { ApiProvider } from './apiprovider';
8-
import { CppToolsApi, CustomConfigurationProvider } from './cppapi';
8+
import { CppToolsApi } from './cppapi';
99

1010
/*
1111
class ShimTools implements CppToolsApi {

extension/src/gradleconfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ export class GradleConfig {
8383

8484
this.disposables.push(this.statusBar);
8585

86-
this.configWatcher.onDidCreate(async e => {
86+
this.configWatcher.onDidCreate(async _ => {
8787
await this.loadConfigs();
8888
}, this.disposables);
8989

90-
this.configWatcher.onDidDelete(e => {
90+
this.configWatcher.onDidDelete(_ => {
9191
this.statusBar.text = 'none';
9292
this.toolchains = [];
9393
this.foundFiles = [];
9494
}, this.disposables);
9595

96-
this.configWatcher.onDidChange(async e => {
96+
this.configWatcher.onDidChange(async _ => {
9797
await this.loadConfigs();
9898
}, this.disposables);
9999
}

extension/tsconfig.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
"target": "es6",
55
"outDir": "out",
66
"lib": [
7-
"es6"
7+
"es6",
8+
"dom"
89
],
910
"sourceMap": true,
1011
"rootDir": "src",
1112
/* Strict Type-Checking Option */
1213
"strict": true, /* enable all strict type-checking options */
1314
/* Additional Checks */
14-
"noUnusedLocals": true /* Report errors on unused locals. */
15-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
16-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
17-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
15+
"noUnusedLocals": true, /* Report errors on unused locals. */
16+
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
17+
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
18+
"noUnusedParameters": true, /* Report errors on unused parameters. */
1819
},
1920
"exclude": [
2021
"node_modules",
2122
".vscode-test"
2223
]
23-
}
24+
}

extension/tslint.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,34 @@
33
"no-string-throw": true,
44
"no-unused-expression": true,
55
"no-duplicate-variable": true,
6+
"no-any": true,
67
"curly": true,
78
"class-name": true,
9+
"no-non-null-assertion": true,
810
"semicolon": [
911
true,
1012
"always"
1113
],
12-
"triple-equals": true
14+
"switch-default": true,
15+
"no-switch-case-fall-through": true,
16+
"await-promise": true,
17+
"no-floating-promises": true,
18+
"quotemark": [true, "single"],
19+
"triple-equals": true,
20+
"no-unnecessary-type-assertion": true,
21+
"prefer-for-of": true,
22+
"prefer-const": true,
23+
"member-access": true,
24+
"forin": true,
25+
"no-for-in-array": true,
26+
"no-use-before-declare": true,
27+
"no-invalid-this": true,
28+
"no-shadowed-variable": true,
29+
"no-this-assignment": true,
30+
"no-unsafe-any": true,
31+
"no-unbound-method": true,
32+
"no-var-keyword": true,
33+
"eofline": true
1334
},
1435
"defaultSeverity": "warning"
15-
}
36+
}

0 commit comments

Comments
 (0)