Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(reports): replace explicit any with number in tickFormatter callbacks (#45794)

Jordi Enricb934e148a38a
diff --git a/apps/studio/components/ui/Charts/ComposedChartHandler.tsx b/apps/studio/components/ui/Charts/ComposedChartHandler.tsx
index 3f9edba6287..1fd4dcceaae 100644
--- a/apps/studio/components/ui/Charts/ComposedChartHandler.tsx
+++ b/apps/studio/components/ui/Charts/ComposedChartHandler.tsx
@@ -46,7 +46,7 @@ export interface ComposedChartHandlerProps {
syncId?: string
YAxisProps?: {
width?: number
- tickFormatter?: (value: any) => string
+ tickFormatter?: (value: number) => string
domain?: [number | string, number | string]
allowDataOverflow?: boolean
}
diff --git a/apps/studio/data/reports/database-charts.ts b/apps/studio/data/reports/database-charts.ts
index 94e0527e20c..5f5c0e5ad9e 100644
--- a/apps/studio/data/reports/database-charts.ts
+++ b/apps/studio/data/reports/database-charts.ts
@@ -48,7 +48,7 @@ export const getReportAttributesV2: (
valuePrecision: 2,
YAxisProps: {
width: 75,
- tickFormatter: (value: any) => formatBytes(value, 2),
+ tickFormatter: (value: number) => formatBytes(value, 2),
},
attributes: [
{
@@ -89,7 +89,7 @@ export const getReportAttributesV2: (
valuePrecision: 2,
YAxisProps: {
width: 75,
- tickFormatter: (value: any) => formatBytes(value, 2),
+ tickFormatter: (value: number) => formatBytes(value, 2),
},
attributes: [
{
@@ -206,7 +206,7 @@ export const getReportAttributesV2: (
showGrid: true,
YAxisProps: {
width: 70,
- tickFormatter: (value: any) => `${formatBytes(value, 1)}/s`,
+ tickFormatter: (value: number) => `${formatBytes(value, 1)}/s`,
},
defaultChartStyle: 'stackedAreaLine',
attributes: [
@@ -238,7 +238,7 @@ export const getReportAttributesV2: (
showMaxValue: true,
YAxisProps: {
width: 55,
- tickFormatter: (value: any) => compactNumberFormatter(value),
+ tickFormatter: (value: number) => compactNumberFormatter(value),
},
defaultChartStyle: 'bar',
attributes: [
@@ -282,7 +282,7 @@ export const getReportAttributesV2: (
showGrid: true,
YAxisProps: {
width: 70,
- tickFormatter: (value: any) => `${formatBytes(value, 1)}/s`,
+ tickFormatter: (value: number) => `${formatBytes(value, 1)}/s`,
},
defaultChartStyle: 'stackedAreaLine',
attributes: [
@@ -479,7 +479,7 @@ export const getReportAttributesV2: (
showGrid: true,
YAxisProps: {
width: 65,
- tickFormatter: (value: any) => formatBytes(value, 1),
+ tickFormatter: (value: number) => formatBytes(value, 1),
},
hideChartType: false,
defaultChartStyle: 'bar',
diff --git a/apps/studio/pages/project/[ref]/observability/database.tsx b/apps/studio/pages/project/[ref]/observability/database.tsx
index 0605f078531..842fa336c06 100644
--- a/apps/studio/pages/project/[ref]/observability/database.tsx
+++ b/apps/studio/pages/project/[ref]/observability/database.tsx
@@ -296,7 +296,7 @@ const DatabaseUsage = () => {
showTooltip
YAxisProps={{
width: 50,
- tickFormatter: (value: any) => `${value}s`,
+ tickFormatter: (value: number) => `${value}s`,
}}
attributes={[
{