From 0060cabfd496de0456c4562cdc47a3607870d6e3 Mon Sep 17 00:00:00 2001 From: belviskhoremk Date: Thu, 13 Aug 2026 09:43:46 +0200 Subject: [PATCH] fix: repair tsc/lint breakage introduced across Tasks 6, 11-13 Two independent plan gaps, both surfaced only now because no prior task in this plan ran a full tsc/lint pass (only scoped vitest per task): 1. Task 6 added required featured/featuredOrder fields to the Product type but only updated products.test.ts's fixture. ProductCard.test.tsx and InquiryModal.test.tsx also construct Product-typed fixtures and were never updated, breaking `tsc -b`/`npm run build`. 2. Tasks 11-13's plan text called the extracted load*() function directly from a bare `useEffect(() => { void load*() }, [])`, which trips this repo's react-hooks/set-state-in-effect rule. This project's established convention (already used in AdminSchedule.tsx) wraps the call in an effect-local inner async function instead. Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH --- src/components/InquiryModal.test.tsx | 1 + src/components/ProductCard.test.tsx | 1 + src/pages/admin/AdminProducts.tsx | 5 ++++- src/pages/admin/AdminRules.tsx | 5 ++++- src/pages/admin/AdminTestimonials.tsx | 5 ++++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/InquiryModal.test.tsx b/src/components/InquiryModal.test.tsx index f8a7e0a..5e25f3c 100644 --- a/src/components/InquiryModal.test.tsx +++ b/src/components/InquiryModal.test.tsx @@ -15,6 +15,7 @@ import type { Product } from '../data/products' const product: Product = { id: 'edge-control', name: 'Silk Edge Control', category: 'hair-care', price: 12, image: '/x.jpg', description: 'Hold with shine.', inStock: true, + featured: false, featuredOrder: null, } describe('InquiryModal', () => { diff --git a/src/components/ProductCard.test.tsx b/src/components/ProductCard.test.tsx index b57294d..7664fe1 100644 --- a/src/components/ProductCard.test.tsx +++ b/src/components/ProductCard.test.tsx @@ -7,6 +7,7 @@ import type { Product } from '../data/products' const product: Product = { id: 'edge-control', name: 'Silk Edge Control', category: 'hair-care', price: 12, image: '/x.jpg', description: 'Hold with shine.', inStock: true, + featured: false, featuredOrder: null, } describe('ProductCard', () => { diff --git a/src/pages/admin/AdminProducts.tsx b/src/pages/admin/AdminProducts.tsx index 2368ce1..d0a634a 100644 --- a/src/pages/admin/AdminProducts.tsx +++ b/src/pages/admin/AdminProducts.tsx @@ -46,7 +46,10 @@ function AdminProducts() { } useEffect(() => { - void loadProducts() + async function load() { + await loadProducts() + } + void load() }, []) async function handleSubmit(event: FormEvent) { diff --git a/src/pages/admin/AdminRules.tsx b/src/pages/admin/AdminRules.tsx index 4109130..9f81cf1 100644 --- a/src/pages/admin/AdminRules.tsx +++ b/src/pages/admin/AdminRules.tsx @@ -42,7 +42,10 @@ function AdminRules() { } useEffect(() => { - void loadRules() + async function load() { + await loadRules() + } + void load() }, []) async function handleSubmit(event: FormEvent) { diff --git a/src/pages/admin/AdminTestimonials.tsx b/src/pages/admin/AdminTestimonials.tsx index 0244b5f..6edd9ad 100644 --- a/src/pages/admin/AdminTestimonials.tsx +++ b/src/pages/admin/AdminTestimonials.tsx @@ -34,7 +34,10 @@ function AdminTestimonials() { } useEffect(() => { - void loadTestimonials() + async function load() { + await loadTestimonials() + } + void load() }, []) async function handleSubmit(event: FormEvent) {