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
This commit is contained in:
belviskhoremk
2026-08-13 09:43:46 +02:00
parent 2093b9ca3a
commit 0060cabfd4
5 changed files with 14 additions and 3 deletions

View File

@@ -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', () => {

View File

@@ -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', () => {

View File

@@ -46,7 +46,10 @@ function AdminProducts() {
}
useEffect(() => {
void loadProducts()
async function load() {
await loadProducts()
}
void load()
}, [])
async function handleSubmit(event: FormEvent) {

View File

@@ -42,7 +42,10 @@ function AdminRules() {
}
useEffect(() => {
void loadRules()
async function load() {
await loadRules()
}
void load()
}, [])
async function handleSubmit(event: FormEvent) {

View File

@@ -34,7 +34,10 @@ function AdminTestimonials() {
}
useEffect(() => {
void loadTestimonials()
async function load() {
await loadTestimonials()
}
void load()
}, [])
async function handleSubmit(event: FormEvent) {