From e32800bf063fbe1dfaf4805c4c0189d4e2126f07 Mon Sep 17 00:00:00 2001 From: abdout Date: Sat, 25 Apr 2026 12:37:43 +0300 Subject: [PATCH] chore(ts): mechanical strict-mode prep fixes (Class 4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seven isolated, non-decision TS errors surfaced by the ignoreBuildErrors audit — all type-only or trivial: - prisma.config: drop earlyAccess (Prisma 7 GA dropped the opt-in) - sitemap: drop redundant Locale[] cast on readonly array - chat-button: initialize useRef with null (React 19 requirement) - pricing/features: type the icon key as keyof typeof Icons - language-switcher: drop unreachable || fallback (TS narrowed to never) - optimized-image: add quality?: number to OptimizedImageProps - wizard/branding: ZodError.errors → error.issues (Zod 4) Closes #11 Co-Authored-By: Claude Opus 4.7 (1M context) --- prisma.config.ts | 1 - src/app/sitemap.ts | 4 ++-- src/components/chatbot/chat-button.tsx | 4 ++-- src/components/marketing/pricing/sections/features.tsx | 3 ++- src/components/ui/language-switcher.tsx | 4 ++-- src/components/ui/optimized-image.tsx | 1 + src/components/wizard/branding/actions.ts | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/prisma.config.ts b/prisma.config.ts index 8b22f3e..6c1a618 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -2,6 +2,5 @@ import 'dotenv/config' import { defineConfig } from 'prisma/config' export default defineConfig({ - earlyAccess: true, schema: './prisma/schema.prisma', }) diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 53f10cb..f4ce45c 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -1,7 +1,7 @@ import { MetadataRoute } from 'next'; -import { type Locale, i18n } from '@/components/internationalization/config'; +import { i18n } from '@/components/internationalization/config'; -const locales: Locale[] = i18n.locales; +const locales = i18n.locales; const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3001'; // Define all your pages here diff --git a/src/components/chatbot/chat-button.tsx b/src/components/chatbot/chat-button.tsx index ed009fb..8a1d165 100644 --- a/src/components/chatbot/chat-button.tsx +++ b/src/components/chatbot/chat-button.tsx @@ -14,8 +14,8 @@ export function ChatButton({ dictionary }: ChatButtonProps) { const [shouldInvert, setShouldInvert] = useState(false); - const checkTimeoutRef = useRef(); - const rafRef = useRef(); + const checkTimeoutRef = useRef(null); + const rafRef = useRef(null); useEffect(() => { const checkSections = () => { diff --git a/src/components/marketing/pricing/sections/features.tsx b/src/components/marketing/pricing/sections/features.tsx index 797f651..1b50b15 100644 --- a/src/components/marketing/pricing/sections/features.tsx +++ b/src/components/marketing/pricing/sections/features.tsx @@ -20,7 +20,8 @@ export default function Features() {
{features.map((feature) => { - const Icon = Icons[feature.icon || "nextjs"]; + const iconKey = (feature.icon || "nextjs") as keyof typeof Icons; + const Icon = Icons[iconKey]; return (
- {currentLanguage?.nativeName || currentLanguage?.name} + {currentLanguage?.nativeName} diff --git a/src/components/ui/optimized-image.tsx b/src/components/ui/optimized-image.tsx index 51047cb..b9000d5 100644 --- a/src/components/ui/optimized-image.tsx +++ b/src/components/ui/optimized-image.tsx @@ -15,6 +15,7 @@ interface OptimizedImageProps extends ComponentProps<'img'> { priority?: boolean; placeholder?: 'blur' | 'empty'; blurDataURL?: string; + quality?: number; } export function OptimizedImage({ diff --git a/src/components/wizard/branding/actions.ts b/src/components/wizard/branding/actions.ts index e235c8f..48f515b 100644 --- a/src/components/wizard/branding/actions.ts +++ b/src/components/wizard/branding/actions.ts @@ -28,7 +28,7 @@ export async function updateBranding( if (error instanceof z.ZodError) { return { success: false, - error: error.errors[0]?.message || "Validation failed", + error: error.issues[0]?.message || "Validation failed", }; }