feat(frontend): biome

This commit is contained in:
ryan
2026-07-22 22:24:32 +08:00
parent f28aa6520e
commit 5b1e27d0a3
15 changed files with 338 additions and 176 deletions
@@ -97,7 +97,8 @@ function SparklineMetricCard({
formatter: (params: unknown) => {
const items = Array.isArray(params) ? params : [];
const item = items[0] as
{ axisValueLabel?: string; value?: number } | undefined;
| { axisValueLabel?: string; value?: number }
| undefined;
if (!item) return '';
const raw = typeof item.value === 'number' ? item.value : 0;
const formatted = valueFormatter
@@ -206,7 +206,8 @@ export function RatePressureChart({ data, hours }: RatePressureChartProps) {
const applyVisibleAxisMax = useCallback(
(startPercent: number, endPercent: number) => {
const instance = chartRef.current?.getEchartsInstance?.() as
EChartsType | undefined;
| EChartsType
| undefined;
if (!instance) return;
instance.setOption(
{
@@ -242,7 +243,8 @@ export function RatePressureChart({ data, hours }: RatePressureChartProps) {
}>;
}) => {
const instance = chartRef.current?.getEchartsInstance?.() as
EChartsType | undefined;
| EChartsType
| undefined;
const { start, end } = readZoomPercent(
params,
chartModel.rpsValues.length,
@@ -335,7 +335,7 @@ export function RuleFlowCanvas({
);
const contextCanDeleteEdge = Boolean(
contextMenu?.kind === 'edge' &&
graph.edges.some((edge) => edge.id === contextMenu.id),
graph.edges.some((edge) => edge.id === contextMenu.id),
);
return (