fix: Resolve web package lint and typecheck errors
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Fixes ESLint and TypeScript errors in web package to pass CI checks:

- Fixed all Quality Rails violations (14 explicit any types)
- Fixed deprecated React event types (FormEvent → SyntheticEvent)
- Fixed 26 TypeScript errors (Promise types, test mocks, HTMLElement assertions)
- Added vitest DOM matcher type definitions
- Fixed unused variables and empty functions
- Resolved 43+ additional lint errors

Typecheck:  0 errors
Lint: 542 remaining (non-blocking in CI)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 21:34:12 -06:00
parent c221b63d14
commit f0704db560
45 changed files with 164 additions and 108 deletions

View File

@@ -123,9 +123,10 @@ export function ExportButton({ graph, mermaid }: ExportButtonProps) {
case "mermaid":
exportAsMermaid();
break;
case "png":
case "png": {
await exportAsPng();
break;
}
case "svg":
exportAsSvg();
break;

View File

@@ -26,13 +26,13 @@ export function NodeCreateModal({ onClose, onCreate }: NodeCreateModalProps) {
const [domain, setDomain] = useState("");
const [isSubmitting, setIsSubmitting] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {
e.preventDefault();
if (!title.trim()) return;
setIsSubmitting(true);
try {
await onCreate({
const result = await onCreate({
title: title.trim(),
node_type: nodeType,
content: content.trim() || null,
@@ -43,6 +43,7 @@ export function NodeCreateModal({ onClose, onCreate }: NodeCreateModalProps) {
domain: domain.trim() || null,
metadata: {},
});
return result;
} finally {
setIsSubmitting(false);
}

View File

@@ -284,7 +284,7 @@ export function useGraphData(options: UseGraphDataOptions = {}): UseGraphDataRes
}, [accessToken]);
const fetchMermaid = useCallback(
(style: "flowchart" | "mindmap" = "flowchart"): void => {
async (style: "flowchart" | "mindmap" = "flowchart"): Promise<void> => {
if (!graph) {
setError("No graph data available");
return;
@@ -356,7 +356,7 @@ export function useGraphData(options: UseGraphDataOptions = {}): UseGraphDataRes
[graph]
);
const fetchStatistics = useCallback((): void => {
const fetchStatistics = useCallback(async (): Promise<void> => {
if (!graph) return;
try {
@@ -577,7 +577,7 @@ export function useGraphData(options: UseGraphDataOptions = {}): UseGraphDataRes
// Update statistics when graph changes
useEffect(() => {
if (graph) {
void fetchStatistics();
fetchStatistics();
}
}, [graph, fetchStatistics]);