refactor: eliminate ~400 no-explicit-any warnings across the workspace
Parallel subagent pass: four typescript-pro agents on non-overlapping scopes.
Patterns applied:
- catch (err: any) { ... err.message ... } → catch (err) { ... getErrorMessage(err) ... }
using the new @fusion/core helper. Bare catch {} where the error was unused.
- SQLite row types: defined typed XxxRow interfaces per table and cast
.all()/.get() results via `as unknown as XxxRow[]` (the double cast is
required because better-sqlite3 returns Record<string, SQLOutputValue>).
- rowToX(row: any) converters: typed argument with the matching row interface.
- Dynamic settings key writes: (settings as Record<string, unknown>)[key].
- React event handlers and setState callbacks: inferred types or concrete
React.{Mouse,Change,Form}Event<...> where needed.
- pi-claude-cli: local PiMessage / PiContext duck types to avoid re-typing
pi-ai concrete shapes; typed Claude stream event message fields.
72 files changed, ~400 anys eliminated. Typecheck passes across the workspace.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect, useCallback, useMemo } from "react";
|
||||
import { Plus, Zap, Globe, Folder, X } from "lucide-react";
|
||||
import type { Routine, RoutineCreateInput } from "@fusion/core";
|
||||
import { getErrorMessage } from "@fusion/core";
|
||||
import {
|
||||
fetchRoutines,
|
||||
createRoutine,
|
||||
@@ -46,8 +47,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
try {
|
||||
const data = await fetchRoutines(scopeOptions);
|
||||
setRoutines(data);
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to load routines", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to load routines", "error");
|
||||
}
|
||||
}, [addToast, scopeOptions]);
|
||||
|
||||
@@ -95,8 +96,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
addToast("Routine created", "success");
|
||||
setRoutineView("list");
|
||||
await loadRoutines();
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to create routine", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to create routine", "error");
|
||||
}
|
||||
},
|
||||
[addToast, loadRoutines, scopeOptions],
|
||||
@@ -116,8 +117,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
setRoutineView("list");
|
||||
setEditingRoutine(undefined);
|
||||
await loadRoutines();
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to update routine", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to update routine", "error");
|
||||
}
|
||||
},
|
||||
[editingRoutine, addToast, loadRoutines, scopeOptions],
|
||||
@@ -129,8 +130,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
await deleteRoutine(routine.id, scopeOptions);
|
||||
addToast(`Deleted "${routine.name}"`, "success");
|
||||
await loadRoutines();
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to delete routine", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to delete routine", "error");
|
||||
}
|
||||
},
|
||||
[addToast, loadRoutines, scopeOptions],
|
||||
@@ -147,8 +148,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
addToast(`"${routine.name}" failed: ${result.error || "Unknown error"}`, "error");
|
||||
}
|
||||
await loadRoutines();
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to run routine", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to run routine", "error");
|
||||
} finally {
|
||||
setRunningRoutineId(null);
|
||||
}
|
||||
@@ -165,8 +166,8 @@ export function ScheduledTasksModal({ onClose, addToast, projectId }: ScheduledT
|
||||
"success",
|
||||
);
|
||||
await loadRoutines();
|
||||
} catch (err: any) {
|
||||
addToast(err.message || "Failed to toggle routine", "error");
|
||||
} catch (err) {
|
||||
addToast(getErrorMessage(err) || "Failed to toggle routine", "error");
|
||||
}
|
||||
},
|
||||
[addToast, loadRoutines, scopeOptions],
|
||||
|
||||
Reference in New Issue
Block a user