fix: resolve majority of lint errors across codebase

- Remove unused imports from page.tsx, clients/page.tsx, invoices/page.tsx
- Remove unused imports from invoice-form.tsx, invoice-workspace.tsx
- Move CustomTooltip outside component in revenue-chart.tsx (fixes react-hooks/static-components)
- Fix type safety in umami.ts (any -> unknown)
- Fix type safety in sidebar-provider.tsx (add type assertion)
- Add no-op comments to empty fallback functions in animation-preferences-provider.tsx
- Fix type safety in invoice-workspace.tsx (any[] -> typed array)

Note: dashboard/page.tsx still has ~55 type safety warnings related to 'any' types
in stats/invoice data. These are pre-existing and would require significant refactoring
of the dashboard data flow to properly type. TypeScript compilation passes.
This commit is contained in:
2025-12-11 20:05:34 -05:00
parent 50735b74ea
commit cf4ef928b8
9 changed files with 45 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
"use client";
import * as React from "react";
import { useState, useEffect, useRef } from "react";
import { useState, useEffect } from "react";
import { useRouter } from "next/navigation";
import { Button } from "~/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";

View File

@@ -3,9 +3,7 @@
import * as React from "react";
import { cn } from "~/lib/utils";
import { Button } from "~/components/ui/button";
import { Card, CardContent } from "~/components/ui/card";
import { ScrollArea } from "~/components/ui/scroll-area";
import { List, Calendar as CalendarIcon, Plus } from "lucide-react";
import { List, Calendar as CalendarIcon } from "lucide-react";
import { InvoiceLineItems } from "../invoice-line-items";
import { InvoiceCalendarView } from "../invoice-calendar-view";
import type { InvoiceFormData } from "./types";
@@ -19,7 +17,7 @@ interface InvoiceWorkspaceProps {
updateItem: (index: number, field: string, value: string | number | Date) => void;
moveItemUp: (index: number) => void;
moveItemDown: (index: number) => void;
reorderItems: (items: any[]) => void;
reorderItems: (items: InvoiceFormData['items']) => void;
className?: string;
}

View File

@@ -20,7 +20,7 @@ export function SidebarProvider({ children }: { children: React.ReactNode }) {
React.useEffect(() => {
const saved = localStorage.getItem("sidebar-collapsed");
if (saved) {
setIsCollapsed(JSON.parse(saved));
setIsCollapsed(JSON.parse(saved) as boolean);
}
}, []);

View File

@@ -403,9 +403,9 @@ export function useAnimationPreferences(): AnimationPreferencesContextValue {
return {
prefersReducedMotion: false,
animationSpeedMultiplier: 1,
updatePreferences: () => { },
setPrefersReducedMotion: () => { },
setAnimationSpeedMultiplier: () => { },
updatePreferences: () => { /* no-op fallback */ },
setPrefersReducedMotion: () => { /* no-op fallback */ },
setAnimationSpeedMultiplier: () => { /* no-op fallback */ },
isUpdating: false,
lastSyncedAt: null,
};