From b9ad8c46df1c0928a90b4d2bc3008db1dfc5e693 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 17:21:20 +0000 Subject: [PATCH] Add TypeScript type checking to website build process - Add 'tsc --noEmit' to build script to catch type errors - Add standalone 'typecheck' script for manual type checking - Fix implicit 'any' type in demo.ts map callback This ensures type errors like 'getAllRoutes is not a function' are caught at build time instead of runtime. --- website/demo.ts | 2 +- website/package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/website/demo.ts b/website/demo.ts index cf7092b..c360e87 100644 --- a/website/demo.ts +++ b/website/demo.ts @@ -105,7 +105,7 @@ function renderRoutes() { return; } - const html = routes.map(route => { + const html = routes.map((route): string => { const bgColor = route.route_color ? `#${route.route_color}` : '#64748b'; const textColor = route.route_text_color ? `#${route.route_text_color}` : getContrastColor(bgColor); diff --git a/website/package.json b/website/package.json index 6168362..a2b05a7 100644 --- a/website/package.json +++ b/website/package.json @@ -5,7 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "tsc --noEmit && vite build", + "typecheck": "tsc --noEmit", "preview": "vite preview" }, "devDependencies": {