Skip to content

Commit f9c6220

Browse files
authored
refactor: clean up types in DAUChart (#4737)
This cleans up some types in `DAUChart.tsx`. Previously, we were type-casting which can lead to errors in production.
1 parent afb806f commit f9c6220

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

site/src/pages/TemplatePage/TemplateSummaryPage/DAUChart.tsx

+5-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const DAUChart: FC<DAUChartProps> = ({
7171
defaults.font.family = theme.typography.fontFamily as string
7272
defaults.color = theme.palette.text.secondary
7373

74-
const options = {
74+
const options: ChartOptions<"line"> = {
7575
responsive: true,
7676
plugins: {
7777
legend: {
@@ -95,7 +95,7 @@ export const DAUChart: FC<DAUChartProps> = ({
9595
},
9696
},
9797
aspectRatio: 10 / 1,
98-
} as ChartOptions
98+
}
9999

100100
return (
101101
<>
@@ -119,16 +119,13 @@ export const DAUChart: FC<DAUChartProps> = ({
119119
{
120120
label: "Daily Active Users",
121121
data: data,
122-
lineTension: 1 / 4,
122+
tension: 1 / 4,
123123
backgroundColor: theme.palette.secondary.dark,
124124
borderColor: theme.palette.secondary.dark,
125125
},
126-
// There are type bugs in chart.js that force us to use any.
127-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
128-
] as any,
126+
],
129127
}}
130-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
131-
options={options as any}
128+
options={options}
132129
height={400}
133130
/>
134131
</WorkspaceSection>

0 commit comments

Comments
 (0)