refactor: eliminate remaining 15 any warnings and ratchet rule to error
- TaskCard: four catch((err: any) => err.message) promise handlers in
archive/unarchive/delete/move → catch((err) => getErrorMessage(err)).
- InlineCreateCard + QuickEntryBox: .catch((err: any)) model-load handlers
→ getErrorMessage(err) with existing @fusion/core import.
- TerminalModal: drop (navigator as any).maxTouchPoints — modern lib.dom
types already expose the property.
- serve.ts: remove unused any annotation on OpenRouter model mapper; the
array element type is already inferred from json.data.
- pi.js, runtime-resolution.ts, dashboard.ts, serve.ts, dev-server-port-
detect.ts, devserver-manager.ts: drop now-stale eslint-disable comments
that the cleanup made redundant.
Fix a prompt-builder regression surfaced by agent's `any` cleanup: toolCall
with a raw string `arguments` field must be preserved verbatim (JSON-quoted)
rather than coerced to `{}`; restores a previously-passing test.
Then promote @typescript-eslint/no-explicit-any from warn → error. Future
new anys must either come with a one-line disable + justification or use a
real type. Workspace is now lint-clean (0 problems).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -189,9 +189,9 @@ export function InlineCreateCard({
|
||||
setFavoriteModels(response.favoriteModels);
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
.catch((err) => {
|
||||
if (!cancelled) {
|
||||
setModelsError(err?.message || "Failed to load models");
|
||||
setModelsError(getErrorMessage(err) || "Failed to load models");
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -175,9 +175,9 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels,
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
.catch((err) => {
|
||||
if (!cancelled) {
|
||||
setModelsError(err?.message || "Failed to load models");
|
||||
setModelsError(getErrorMessage(err) || "Failed to load models");
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -702,8 +702,8 @@ function TaskCardComponent({
|
||||
|
||||
void onArchiveTask(task.id).then(() => {
|
||||
addToast(`Archived ${task.id}`, "success");
|
||||
}).catch((err: any) => {
|
||||
addToast(`Failed to archive ${task.id}: ${err.message}`, "error");
|
||||
}).catch((err) => {
|
||||
addToast(`Failed to archive ${task.id}: ${getErrorMessage(err)}`, "error");
|
||||
});
|
||||
}, [addToast, onArchiveTask, task.id]);
|
||||
|
||||
@@ -713,8 +713,8 @@ function TaskCardComponent({
|
||||
|
||||
void onUnarchiveTask(task.id).then(() => {
|
||||
addToast(`Unarchived ${task.id}`, "success");
|
||||
}).catch((err: any) => {
|
||||
addToast(`Failed to unarchive ${task.id}: ${err.message}`, "error");
|
||||
}).catch((err) => {
|
||||
addToast(`Failed to unarchive ${task.id}: ${getErrorMessage(err)}`, "error");
|
||||
});
|
||||
}, [addToast, onUnarchiveTask, task.id]);
|
||||
|
||||
@@ -725,8 +725,8 @@ function TaskCardComponent({
|
||||
if (window.confirm(`Delete ${task.id}?`)) {
|
||||
void onDeleteTask(task.id).then(() => {
|
||||
addToast(`Deleted ${task.id}`, "success");
|
||||
}).catch((err: any) => {
|
||||
addToast(`Failed to delete ${task.id}: ${err.message}`, "error");
|
||||
}).catch((err) => {
|
||||
addToast(`Failed to delete ${task.id}: ${getErrorMessage(err)}`, "error");
|
||||
});
|
||||
}
|
||||
}, [addToast, onDeleteTask, task.id]);
|
||||
@@ -760,8 +760,8 @@ function TaskCardComponent({
|
||||
|
||||
void onMoveTask(task.id, column).then(() => {
|
||||
addToast(`Moved ${task.id} to ${COLUMN_LABELS[column]}`, "success");
|
||||
}).catch((err: any) => {
|
||||
addToast(`Failed to move ${task.id}: ${err.message}`, "error");
|
||||
}).catch((err) => {
|
||||
addToast(`Failed to move ${task.id}: ${getErrorMessage(err)}`, "error");
|
||||
});
|
||||
}, [addToast, onMoveTask, task.id]);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ export async function retryDynamicImport<T>(
|
||||
function isMobileDevice(): boolean {
|
||||
if (typeof window === "undefined") return false;
|
||||
const hasTouchScreen =
|
||||
"ontouchstart" in window || (navigator as any).maxTouchPoints > 0;
|
||||
"ontouchstart" in window || navigator.maxTouchPoints > 0;
|
||||
const isNarrow = window.innerWidth <= 768;
|
||||
return hasTouchScreen && isNarrow;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,6 @@ export async function probeFallbackPorts(host = DEFAULT_PROBE_HOST, timeoutMs =
|
||||
}
|
||||
|
||||
// Probe sequentially so first responsive common port wins deterministically.
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const isOpen = await probePort(safeHost, port, safeTimeout);
|
||||
if (isOpen) {
|
||||
return {
|
||||
|
||||
@@ -312,7 +312,6 @@ export class DevServerManager extends EventEmitter<DevServerManagerEvents> {
|
||||
|
||||
private async findFirstReachablePort(ports: number[]): Promise<number | null> {
|
||||
for (const port of ports) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const reachable = await probePort(port);
|
||||
if (reachable) {
|
||||
return port;
|
||||
|
||||
Reference in New Issue
Block a user