Problem
Multiple components use any types extensively instead of proper TypeScript types. This defeats TypeScript's type safety and makes it harder to catch bugs at compile time.
Instances Found
modules/playground/components/MainPlaygroundPage.tsx
- Line 64:
interface MainPlaygroundPageProps { initialData: any; ... } — initialData should be typed as the Playground+TemplateFile shape
- Line 70:
rawContent derived from initialData?.templateFiles?.[0]?.content as untyped
modules/playground/components/playground-header.tsx
- Line 25:
playgroundData: any;
- Line 28:
activeFile: any;
modules/playground/components/collaboration-avatars.tsx
- Line 7:
const [users, setUsers] = useState<any[]>([]);
modules/playground/components/ai-chat-panel.tsx
- Line 340:
{messages.map((msg: any) => {
- Line 341:
const rawParts: any[] = (msg as any).parts ?? [];
- Lines 345, 347, 353: multiple
(p: any) usages
modules/playground/components/playground-editor.tsx
- Line 49:
const handleEditorDidMount = (editor: any, monaco: Monaco) => {
- Line 61:
editor.onDidChangeCursorPosition((e: any) => {
Expected Fix
Define proper interfaces for:
PlaygroundData (playground + template files shape from Prisma)
ActiveFile (TemplateFile extended with hasUnsavedChanges)
CollaboratorUser (name + color shape from Yjs awareness)
Then replace any usage with these typed interfaces.
Why This Matters
- TypeScript errors are already suppressed in builds (
ignoreBuildErrors: true) — fixing any types is a prerequisite to safely re-enabling type checking
any in the message types means AI chat bugs won't be caught by the compiler
- The
initialData: any means a malformed server response could crash the playground silently
Files Affected
modules/playground/components/MainPlaygroundPage.tsx
modules/playground/components/playground-header.tsx
modules/playground/components/collaboration-avatars.tsx
modules/playground/components/ai-chat-panel.tsx
modules/playground/components/playground-editor.tsx
Problem
Multiple components use
anytypes extensively instead of proper TypeScript types. This defeats TypeScript's type safety and makes it harder to catch bugs at compile time.Instances Found
modules/playground/components/MainPlaygroundPage.tsxinterface MainPlaygroundPageProps { initialData: any; ... }—initialDatashould be typed as the Playground+TemplateFile shaperawContentderived frominitialData?.templateFiles?.[0]?.contentas untypedmodules/playground/components/playground-header.tsxplaygroundData: any;activeFile: any;modules/playground/components/collaboration-avatars.tsxconst [users, setUsers] = useState<any[]>([]);modules/playground/components/ai-chat-panel.tsx{messages.map((msg: any) => {const rawParts: any[] = (msg as any).parts ?? [];(p: any)usagesmodules/playground/components/playground-editor.tsxconst handleEditorDidMount = (editor: any, monaco: Monaco) => {editor.onDidChangeCursorPosition((e: any) => {Expected Fix
Define proper interfaces for:
PlaygroundData(playground + template files shape from Prisma)ActiveFile(TemplateFile extended withhasUnsavedChanges)CollaboratorUser(name + color shape from Yjs awareness)Then replace
anyusage with these typed interfaces.Why This Matters
ignoreBuildErrors: true) — fixinganytypes is a prerequisite to safely re-enabling type checkinganyin the message types means AI chat bugs won't be caught by the compilerinitialData: anymeans a malformed server response could crash the playground silentlyFiles Affected
modules/playground/components/MainPlaygroundPage.tsxmodules/playground/components/playground-header.tsxmodules/playground/components/collaboration-avatars.tsxmodules/playground/components/ai-chat-panel.tsxmodules/playground/components/playground-editor.tsx