diff --git a/eslint.config.mjs b/eslint.config.mjs index 8ab910c3cf..3e83627995 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -37,7 +37,7 @@ export default [ // "require-await": "warn", "@typescript-eslint/no-unused-vars": "error", // Some untyped things may require extra effort to be fixed - "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-explicit-any": "warn", // replacement of ESLint's no-redeclare with support for function overload "@typescript-eslint/no-redeclare": "error", // require awaiting or .then() chaining for promises diff --git a/src/authz/schemaRegistry.ts b/src/authz/schemaRegistry.ts index c8a19bc9f9..45854f186c 100644 --- a/src/authz/schemaRegistry.ts +++ b/src/authz/schemaRegistry.ts @@ -1,4 +1,4 @@ -import { ResponseError, SubjectsV1Api } from "../clients/schemaRegistryRest"; +import { ErrorMessage, ResponseError, SubjectsV1Api } from "../clients/schemaRegistryRest"; import { SCHEMA_RBAC_WARNINGS_ENABLED } from "../extensionSettings/constants"; import { CCloudResourceLoader } from "../loaders"; import { Logger } from "../logging"; @@ -79,7 +79,7 @@ export async function canAccessSchemaTypeForTopic( } export async function determineAccessFromResponseError(response: Response): Promise { - let body: any; + let body: ErrorMessage; try { body = await response.json(); } catch (error) { diff --git a/src/ccloudStatus/types.ts b/src/ccloudStatus/types.ts index 47899f11c4..e3f6cf701d 100644 --- a/src/ccloudStatus/types.ts +++ b/src/ccloudStatus/types.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any -- The existing uses of `any` model the same patterns in our `src/clients` model files. */ + /** * A Statuspage page object. * @see https://status.confluent.cloud/api/v2 diff --git a/src/codelens/flinkSqlProvider.test.ts b/src/codelens/flinkSqlProvider.test.ts index fcc5e12942..968062ee67 100644 --- a/src/codelens/flinkSqlProvider.test.ts +++ b/src/codelens/flinkSqlProvider.test.ts @@ -677,7 +677,7 @@ describe("codelens/flinkSqlProvider.ts", () => { kafkaClusters: [ CCloudKafkaCluster.create({ ...TEST_CCLOUD_KAFKA_CLUSTER, - id: "lkc-duplicate" as any, + id: "lkc-duplicate", name: TEST_CCLOUD_KAFKA_CLUSTER.name, }), ], diff --git a/src/commands/diffs.ts b/src/commands/diffs.ts index 3cc01e48ee..9e307b7fad 100644 --- a/src/commands/diffs.ts +++ b/src/commands/diffs.ts @@ -10,7 +10,7 @@ import { getWorkspaceState } from "../storage/utils"; const logger = new Logger("commands.diffs"); -export async function selectForCompareCommand(item: any) { +export async function selectForCompareCommand(item: vscode.Uri | Schema | undefined) { if (!item) { return; } @@ -25,7 +25,7 @@ export async function selectForCompareCommand(item: any) { await setContextValue(ContextValues.resourceSelectedForCompare, true); } -export async function compareWithSelectedCommand(item: any) { +export async function compareWithSelectedCommand(item: vscode.Uri | Schema | undefined) { if (!item) { return; } @@ -69,7 +69,7 @@ export function registerDiffCommands(): vscode.Disposable[] { * @returns The URI for the resource item * @throws Error if the resource item is not yet supported */ -function convertItemToUri(item: any): vscode.Uri { +function convertItemToUri(item: vscode.Uri | Schema): vscode.Uri { if (item instanceof vscode.Uri) { return item; } else if (item instanceof Schema) {