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,5 +1,5 @@
|
||||
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||
import { Type } from "typebox";
|
||||
import { Type, type TSchema } from "typebox";
|
||||
import { StringEnum } from "@mariozechner/pi-ai";
|
||||
import {
|
||||
TaskStore,
|
||||
@@ -298,7 +298,7 @@ export default function kbExtension(pi: ExtensionAPI) {
|
||||
column: Type.Optional(
|
||||
StringEnum([...COLUMNS] as unknown as string[], {
|
||||
description: "Filter to a specific column",
|
||||
}) as any,
|
||||
}) as unknown as TSchema,
|
||||
),
|
||||
limit: Type.Optional(
|
||||
Type.Number({
|
||||
@@ -1039,10 +1039,10 @@ export default function kbExtension(pi: ExtensionAPI) {
|
||||
let taskId: string | undefined;
|
||||
try {
|
||||
taskId = await runTaskPlan(params.description, true); // Use --yes flag for non-interactive
|
||||
} catch (err: any) {
|
||||
} catch (err) {
|
||||
console.error = originalError;
|
||||
console.log = originalLog;
|
||||
throw new Error(`Planning mode failed: ${err.message}`);
|
||||
throw new Error(`Planning mode failed: ${err instanceof Error ? err.message : String(err)}`);
|
||||
} finally {
|
||||
console.error = originalError;
|
||||
console.log = originalLog;
|
||||
|
||||
Reference in New Issue
Block a user