fix: prisma generate in CI en expliciete types in map/filter callbacks

This commit is contained in:
Janpeter Visser 2026-04-24 14:23:41 +02:00
parent 7dfc389be4
commit 567e91493e
4 changed files with 12 additions and 9 deletions

View file

@ -24,6 +24,9 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- name: Lint
run: npm run lint

View file

@ -89,7 +89,7 @@ export default async function ProductBacklogPage({ params }: Props) {
left={
<PbiList
productId={id}
pbis={pbis.map(p => ({ id: p.id, title: p.title, priority: p.priority }))}
pbis={pbis.map((p: (typeof pbis)[number]) => ({ id: p.id, title: p.title, priority: p.priority }))}
isDemo={isDemo}
/>
}

View file

@ -34,13 +34,13 @@ export default async function SprintBacklogPage({ params }: Props) {
include: { tasks: { select: { id: true, status: true } } },
})
const sprintStoryItems: SprintStory[] = sprintStories.map(s => ({
const sprintStoryItems: SprintStory[] = sprintStories.map((s: (typeof sprintStories)[number]) => ({
id: s.id,
title: s.title,
priority: s.priority,
status: s.status,
taskCount: s.tasks.length,
doneCount: s.tasks.filter(t => t.status === 'DONE').length,
doneCount: s.tasks.filter((t: (typeof s.tasks)[number]) => t.status === 'DONE').length,
}))
// All PBIs with their non-sprint stories for the right panel
@ -55,11 +55,11 @@ export default async function SprintBacklogPage({ params }: Props) {
})
const pbisWithStories: PbiWithStories[] = pbis
.filter(pbi => pbi.stories.length > 0)
.map(pbi => ({
.filter((pbi: (typeof pbis)[number]) => pbi.stories.length > 0)
.map((pbi: (typeof pbis)[number]) => ({
id: pbi.id,
title: pbi.title,
stories: pbi.stories.map(s => ({
stories: pbi.stories.map((s: (typeof pbi.stories)[number]) => ({
id: s.id,
title: s.title,
priority: s.priority,
@ -69,7 +69,7 @@ export default async function SprintBacklogPage({ params }: Props) {
})),
}))
const sprintStoryIds = new Set(sprintStories.map(s => s.id))
const sprintStoryIds = new Set<string>(sprintStories.map((s: (typeof sprintStories)[number]) => s.id))
const isDemo = session.isDemo ?? false
return (

View file

@ -38,13 +38,13 @@ export default async function SprintPlanningPage({ params }: Props) {
},
})
const sprintStoryItems: SprintStory[] = sprintStories.map(s => ({
const sprintStoryItems: SprintStory[] = sprintStories.map((s: (typeof sprintStories)[number]) => ({
id: s.id,
title: s.title,
priority: s.priority,
status: s.status,
taskCount: s.tasks.length,
doneCount: s.tasks.filter(t => t.status === 'DONE').length,
doneCount: s.tasks.filter((t: (typeof s.tasks)[number]) => t.status === 'DONE').length,
}))
// Tasks by story