Fix all ESLint errors: remove unused imports, replace any types
- Remove ~60 unused imports and variables across 88 files - Replace ~80 `any` type annotations with proper types (unknown, Record<string, unknown>, or specific types) - Prefix unused callback args with underscore - Fix unescaped JSX entities - Lint now passes cleanly (0 errors, 2 intentional img warnings) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import { useForm, FormProvider } from 'react-hook-form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { ChevronLeft, ChevronRight, Check, Loader2 } from 'lucide-react';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { InvoiceLineItems } from '@/components/invoices/invoice-line-items';
|
||||
import { apiFetch } from '@/lib/api/client';
|
||||
import { createInvoiceSchema, type CreateInvoiceInput } from '@/lib/validators/invoices';
|
||||
@@ -75,7 +74,7 @@ export default function NewInvoicePage() {
|
||||
method: 'POST',
|
||||
body: data,
|
||||
}),
|
||||
onSuccess: (res: any) => {
|
||||
onSuccess: (res: { data?: { id?: string } }) => {
|
||||
const id = res?.data?.id;
|
||||
if (id) {
|
||||
router.push(`/${portSlug}/invoices/${id}`);
|
||||
@@ -217,7 +216,7 @@ export default function NewInvoicePage() {
|
||||
<Label>Payment Terms</Label>
|
||||
<Select
|
||||
defaultValue="net30"
|
||||
onValueChange={(v) => setValue('paymentTerms', v as any)}
|
||||
onValueChange={(v) => setValue('paymentTerms', v as CreateInvoiceInput['paymentTerms'])}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select terms" />
|
||||
@@ -266,7 +265,7 @@ export default function NewInvoicePage() {
|
||||
<InvoiceLineItems name="lineItems" />
|
||||
{errors.lineItems && !Array.isArray(errors.lineItems) && (
|
||||
<p className="text-xs text-destructive mt-2">
|
||||
{(errors.lineItems as any).message}
|
||||
{(errors.lineItems as { message?: string }).message}
|
||||
</p>
|
||||
)}
|
||||
{errors.root && (
|
||||
|
||||
Reference in New Issue
Block a user