fix(lint): unused vars/imports + react-hook-form watch incompatibility
Resolves de overige lint-warnings van de gefaalde sprint-build die los
staan van PBI-33. Eslint-config staat unused vars/args toe als ze met
'_' prefixen, dus required interface-params krijgen een prefix terwijl
losse dode constantes/imports verwijderd worden.
- sprint-header: productId is required prop maar nog niet gebruikt
→ prefix _productId i.p.v. verwijderen (caller passeert het door)
- agent-throughput: STATUSES-constante was dood — verwijderd, queries
gebruiken hardcoded status-velden in de perDay-loop
- claude-jobs: productAccessFilter en enforceUserRateLimit waren
dode imports — verwijderd
- story-log.test: ongebruikte 'data' binding vervangen door bare
await res.json() zodat de stream nog wel geconsumeerd wordt
- product-dialog: form.watch('auto_pr') vervangen door useWatch met
control-prop — useWatch is veilig voor React Compiler memoization
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e816ccc77a
commit
2f4805fab4
5 changed files with 4 additions and 8 deletions
|
|
@ -129,7 +129,7 @@ describe('POST /api/stories/:id/log', () => {
|
|||
const res = await postStoryLog(
|
||||
...makeRequest({ type: 'TEST_RESULT', content: 'Test gefaald.', status: 'FAILED' })
|
||||
)
|
||||
const data = await res.json()
|
||||
await res.json()
|
||||
|
||||
expect(res.status).toBe(201)
|
||||
expect(mockPrisma.storyLog.create).toHaveBeenCalledWith(
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
import { revalidatePath } from 'next/cache'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { productAccessFilter } from '@/lib/product-access'
|
||||
import { ACTIVE_JOB_STATUSES, jobStatusToApi } from '@/lib/job-status'
|
||||
import { enforceUserRateLimit } from '@/lib/rate-limit'
|
||||
|
||||
type EnqueueResult =
|
||||
| { success: true; jobId: string }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useForm } from 'react-hook-form'
|
||||
import { useForm, useWatch } from 'react-hook-form'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { toast } from 'sonner'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
|
@ -150,7 +150,7 @@ export function ProductDialog(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
const autoPr = form.watch('auto_pr')
|
||||
const autoPr = useWatch({ control: form.control, name: 'auto_pr' })
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function toDateInputValue(d: Date | null) {
|
|||
return d.toISOString().slice(0, 10)
|
||||
}
|
||||
|
||||
export function SprintHeader({ productId, productName, sprint, isDemo, sprintStories }: SprintHeaderProps) {
|
||||
export function SprintHeader({ productId: _productId, productName, sprint, isDemo, sprintStories }: SprintHeaderProps) {
|
||||
const [editingGoal, setEditingGoal] = useState(false)
|
||||
const [editingDates, setEditingDates] = useState(false)
|
||||
const [completeOpen, setCompleteOpen] = useState(false)
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ export interface JobsPerDayResult {
|
|||
kpi: ThroughputKpi
|
||||
}
|
||||
|
||||
const STATUSES = ['queued', 'claimed', 'running', 'done', 'failed', 'cancelled'] as const
|
||||
|
||||
type RawDayRow = { day: Date; status: string; count: bigint }
|
||||
type RawKpiRow = { today_count: bigint; done_7d: bigint; terminal_7d: bigint; avg_seconds: number | null }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue