diff --git a/src/bazel/bazel_query.ts b/src/bazel/bazel_query.ts index 4414768a..bf2f6f1c 100644 --- a/src/bazel/bazel_query.ts +++ b/src/bazel/bazel_query.ts @@ -143,7 +143,7 @@ export class BazelQuery extends BazelCommand { ]); } return new Promise((resolve, reject) => { - const execOptions = { + const execOptions: child_process.ExecFileOptionsWithBufferEncoding = { cwd: this.workingDirectory, // A null encoding causes the callback below to receive binary data as a // Buffer instead of text data as strings. diff --git a/src/buildifier/buildifier_format_provider.ts b/src/buildifier/buildifier_format_provider.ts index 9af8150b..7f78f5c9 100644 --- a/src/buildifier/buildifier_format_provider.ts +++ b/src/buildifier/buildifier_format_provider.ts @@ -51,7 +51,7 @@ export class BuildifierFormatProvider ), ]; return edits; - } catch (err) { + } catch (err: any) { // eslint-disable-next-line @typescript-eslint/no-floating-promises vscode.window.showErrorMessage(`${err}`); } diff --git a/src/workspace-tree/bazel_package_tree_item.ts b/src/workspace-tree/bazel_package_tree_item.ts index 7c6de411..bb9aca52 100644 --- a/src/workspace-tree/bazel_package_tree_item.ts +++ b/src/workspace-tree/bazel_package_tree_item.ts @@ -61,7 +61,7 @@ export class BazelPackageTreeItem ignoresErrors: true, sortByRuleName: true, }); - const targets = queryResult.target.map((target: blaze_query.Target) => { + const targets = queryResult.target.map((target: blaze_query.ITarget) => { return new BazelTargetTreeItem(this.workspaceInfo, target); }); return (this.directSubpackages as IBazelTreeItem[]).concat(targets); diff --git a/src/workspace-tree/bazel_target_tree_item.ts b/src/workspace-tree/bazel_target_tree_item.ts index 36ed9c43..ad5d0069 100644 --- a/src/workspace-tree/bazel_target_tree_item.ts +++ b/src/workspace-tree/bazel_target_tree_item.ts @@ -32,7 +32,7 @@ export class BazelTargetTreeItem */ constructor( private readonly workspaceInfo: BazelWorkspaceInfo, - private readonly target: blaze_query.Target, + private readonly target: blaze_query.ITarget, ) {} public mightHaveChildren(): boolean { diff --git a/src/workspace-tree/bazel_workspace_folder_tree_item.ts b/src/workspace-tree/bazel_workspace_folder_tree_item.ts index 4b36d1ef..40d30ef9 100644 --- a/src/workspace-tree/bazel_workspace_folder_tree_item.ts +++ b/src/workspace-tree/bazel_workspace_folder_tree_item.ts @@ -183,7 +183,7 @@ export class BazelWorkspaceFolderTreeItem implements IBazelTreeItem { ignoresErrors: true, sortByRuleName: true, }); - const targets = queryResult.target.map((target: blaze_query.Target) => { + const targets = queryResult.target.map((target: blaze_query.ITarget) => { return new BazelTargetTreeItem(this.workspaceInfo, target); }); diff --git a/src/workspace-tree/icons.ts b/src/workspace-tree/icons.ts index 0cd1383f..c89fe40f 100644 --- a/src/workspace-tree/icons.ts +++ b/src/workspace-tree/icons.ts @@ -25,7 +25,7 @@ import { blaze_query } from "../protos"; * application/extension/framework targets are shown with folder-like icons * because those bundles are conceptually folders. */ -const SPECIFIC_RULE_CLASS_ICONS = { +const SPECIFIC_RULE_CLASS_ICONS: Record = { android_binary: "android_binary", apple_bundle_import: "resource_bundle", apple_resource_bundle: "resource_bundle", @@ -59,10 +59,10 @@ const SPECIFIC_RULE_CLASS_ICONS = { * @param rule The {@code QueriedRule} representing the build target. */ export function getBazelRuleIcon( - target: blaze_query.Target, + target: blaze_query.ITarget, ): string | vscode.ThemeIcon { const ruleClass = target.rule.ruleClass; - let iconName = SPECIFIC_RULE_CLASS_ICONS[ruleClass] as string; + let iconName = SPECIFIC_RULE_CLASS_ICONS[ruleClass]; if (!iconName) { if (ruleClass.endsWith("_binary")) { iconName = "binary"; diff --git a/tsconfig.json b/tsconfig.json index 0335590e..26baad44 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,8 @@ ], "sourceMap": true, "rootDir": ".", - "alwaysStrict": true, - "allowJs": true + "strict": true, + "strictNullChecks": false }, "exclude": [ "node_modules",