fix: resolve ESLint parse errors, unused imports, and TS unknown type errors
All checks were successful
CI/CD / test (push) Successful in 1m4s
CI/CD / deploy (push) Successful in 2s

- Fix catch blocks with inline comments that broke parsing
- Remove unused Edit3 import from ClientReferrals
- Add eslint-disable for set-state-in-effect (intentional fetch-on-mount pattern)
- Fix 'e' is of type 'unknown' errors with instanceof checks
This commit is contained in:
2026-01-30 04:58:32 +00:00
parent f042c910ee
commit df448a7245
3 changed files with 20 additions and 17 deletions

View File

@@ -48,10 +48,11 @@ export default function ClientDocuments({ clientId }: { clientId: string }) {
try {
const docs = await api.getClientDocuments(clientId, category || undefined);
setDocuments(docs);
} catch {}
} catch { /* silently handled */ }
setLoading(false);
}, [clientId, category]);
// eslint-disable-next-line react-hooks/set-state-in-effect
useEffect(() => { fetchDocs(); }, [fetchDocs]);
const handleUpload = async (files: FileList | File[]) => {
@@ -61,8 +62,8 @@ export default function ClientDocuments({ clientId }: { clientId: string }) {
await api.uploadDocument(clientId, file, { category: uploadCategory });
}
await fetchDocs();
} catch (e: any) {
alert(e.message || 'Upload failed');
} catch (e: unknown) {
alert(e instanceof Error ? e.message : 'Upload failed');
}
setUploading(false);
};
@@ -78,7 +79,7 @@ export default function ClientDocuments({ clientId }: { clientId: string }) {
try {
await api.deleteDocument(docId);
setDocuments(prev => prev.filter(d => d.id !== docId));
} catch {}
} catch { /* silently handled */ }
};
const handleDownload = (docId: string, name: string) => {