Chore: typing fixes (#76859)

This commit is contained in:
Andres Martinez Gotor 2023-10-20 11:32:40 +02:00 committed by GitHub
parent f5758e9f4b
commit bdae561a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -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"]
],

View File

@ -20,7 +20,7 @@ function skipFiles(f: string): boolean {
return true;
}
const config = async (env: any): Promise<Configuration> => {
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
const pluginJson = getPluginJson();
const baseConfig: Configuration = {
cache: {
@ -70,8 +70,8 @@ const config = async (env: any): Promise<Configuration> => {
// 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));