From bdae561a2dd81d917599519b21c0f533466c69a0 Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Fri, 20 Oct 2023 11:32:40 +0200 Subject: [PATCH] Chore: typing fixes (#76859) --- .betterer.results | 5 ----- packages/grafana-plugin-configs/webpack.config.ts | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.betterer.results b/.betterer.results index 051b248f929..11c1a73c70b 100644 --- a/.betterer.results +++ b/.betterer.results @@ -689,11 +689,6 @@ exports[`better eslint`] = { [0, 0, 0, "Styles should be written using objects.", "2"], [0, 0, 0, "Styles should be written using objects.", "3"] ], - "packages/grafana-plugin-configs/webpack.config.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], "packages/grafana-runtime/src/analytics/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], diff --git a/packages/grafana-plugin-configs/webpack.config.ts b/packages/grafana-plugin-configs/webpack.config.ts index 883f1873cbc..315f4a34f07 100644 --- a/packages/grafana-plugin-configs/webpack.config.ts +++ b/packages/grafana-plugin-configs/webpack.config.ts @@ -20,7 +20,7 @@ function skipFiles(f: string): boolean { return true; } -const config = async (env: any): Promise => { +const config = async (env: Record): Promise => { const pluginJson = getPluginJson(); const baseConfig: Configuration = { cache: { @@ -70,8 +70,8 @@ const config = async (env: any): Promise => { // Mark legacy SDK imports as external if their name starts with the "grafana/" prefix ({ request }, callback) => { const prefix = 'grafana/'; - const hasPrefix = (request: any) => request.indexOf(prefix) === 0; - const stripPrefix = (request: any) => request.substr(prefix.length); + const hasPrefix = (request?: string) => request?.indexOf(prefix) === 0; + const stripPrefix = (request?: string) => request?.substr(prefix.length); if (hasPrefix(request)) { return callback(undefined, stripPrefix(request));