diff --git a/.betterer.results b/.betterer.results index c60cffd4c78..0c6162ca93f 100644 --- a/.betterer.results +++ b/.betterer.results @@ -7655,13 +7655,6 @@ exports[`no explicit any`] = { "public/app/plugins/panel/heatmap/palettes.ts:4110363347": [ [87, 59, 3, "Unexpected any. Specify a different type.", "193409811"] ], - "public/app/plugins/panel/heatmap/utils.ts:2711553971": [ - [64, 27, 3, "Unexpected any. Specify a different type.", "193409811"], - [215, 21, 3, "Unexpected any. Specify a different type.", "193409811"], - [396, 21, 3, "Unexpected any. Specify a different type.", "193409811"], - [495, 10, 3, "Unexpected any. Specify a different type.", "193409811"], - [527, 9, 3, "Unexpected any. Specify a different type.", "193409811"] - ], "public/app/plugins/panel/histogram/Histogram.tsx:3993177092": [ [130, 31, 3, "Unexpected any. Specify a different type.", "193409811"], [223, 32, 3, "Unexpected any. Specify a different type.", "193409811"], diff --git a/public/app/plugins/panel/heatmap/utils.ts b/public/app/plugins/panel/heatmap/utils.ts index c4fc2bffc12..0206013bf2b 100644 --- a/public/app/plugins/panel/heatmap/utils.ts +++ b/public/app/plugins/panel/heatmap/utils.ts @@ -62,7 +62,7 @@ interface PrepConfigOpts { theme: GrafanaTheme2; eventBus: EventBus; onhover?: null | ((evt?: HeatmapHoverEvent | null) => void); - onclick?: null | ((evt?: any) => void); + onclick?: null | ((evt?: Object) => void); onzoom?: null | ((evt: HeatmapZoomEvent) => void); isToolTipOpen: MutableRefObject; timeZone: string; @@ -113,8 +113,8 @@ export function prepConfig(opts: PrepConfigOpts) { let rect: DOMRect; builder.addHook('init', (u) => { - u.root.querySelectorAll('.u-cursor-pt').forEach((el) => { - Object.assign((el as HTMLElement).style, { + u.root.querySelectorAll('.u-cursor-pt').forEach((el) => { + Object.assign(el.style, { borderRadius: '0', border: '1px solid white', background: 'transparent', @@ -175,7 +175,7 @@ export function prepConfig(opts: PrepConfigOpts) { }; const hoverEvent = new DataHoverEvent(payload); - let pendingOnleave = 0; + let pendingOnleave: ReturnType | 0; onhover && builder.addHook('setLegend', (u) => { @@ -213,7 +213,7 @@ export function prepConfig(opts: PrepConfigOpts) { payload.rowIndex = undefined; payload.point[xScaleUnit] = null; eventBus.publish(hoverEvent); - }, 100) as any; + }, 100); } } }); @@ -257,6 +257,7 @@ export function prepConfig(opts: PrepConfigOpts) { return builder; // early abort (avoids error) } + // eslint-ignore @typescript-eslint/no-explicit-any const yFieldConfig = yField.config?.custom as PanelFieldConfig | undefined; const yScale = yFieldConfig?.scaleDistribution ?? { type: ScaleDistribution.Linear }; const yAxisReverse = Boolean(yAxisConfig.reverse); @@ -394,7 +395,7 @@ export function prepConfig(opts: PrepConfigOpts) { size: yAxisConfig.axisWidth || null, label: yAxisConfig.axisLabel, theme: theme, - formatValue: (v: any) => formattedValueToString(dispY(v)), + formatValue: (v: number) => formattedValueToString(dispY(v)), splits: isOrdianalY ? (self: uPlot) => { const meta = readHeatmapRowsCustomMeta(dataRef.current?.heatmap); @@ -493,7 +494,7 @@ export function prepConfig(opts: PrepConfigOpts) { index: palette, }, }, - }) as any, + }), theme, scaleKey: '', // facets' scales used (above) }); @@ -525,7 +526,7 @@ export function prepConfig(opts: PrepConfigOpts) { }, }, exemplarFillColor - ) as any, + ), theme, scaleKey: '', // facets' scales used (above) }); @@ -570,6 +571,7 @@ export function prepConfig(opts: PrepConfigOpts) { if (sync && sync() !== DashboardCursorSync.Off) { cursor.sync = { key: '__global_', + scales: [xScaleKey, yScaleKey], filters: { pub: (type: string, src: uPlot, x: number, y: number, w: number, h: number, dataIdx: number) => { if (x < 0) { @@ -705,6 +707,8 @@ export function heatmapPathsDense(opts: PathbuilderOpts) { return null; } ); + + return null; }; } @@ -765,6 +769,8 @@ export function heatmapPathsPoints(opts: PointsBuilderOpts, exemplarColor: strin u.ctx.restore(); } ); + + return null; }; } // accepts xMax, yMin, yMax, count @@ -881,10 +887,10 @@ export function heatmapPathsSparse(opts: PathbuilderOpts) { u.ctx.restore(); //console.timeEnd('heatmapPathsSparse'); - - return null; } ); + + return null; }; }