Fix TypeScript and ESLint errors for production build
This commit is contained in:
parent
5b3691826b
commit
ae5c952ab1
@ -25,6 +25,7 @@ import { Plus, Calendar, Flag, GripVertical } from "lucide-react"
|
||||
import { format, parseISO } from "date-fns"
|
||||
|
||||
const statusColumns = ["backlog", "in-progress", "review", "done"] as const
|
||||
type SprintColumnStatus = typeof statusColumns[number]
|
||||
|
||||
const statusLabels: Record<string, string> = {
|
||||
backlog: "To Do",
|
||||
@ -149,7 +150,6 @@ export function SprintBoard() {
|
||||
selectedSprintId,
|
||||
selectSprint,
|
||||
selectedProjectId,
|
||||
selectedTaskId,
|
||||
updateTask,
|
||||
selectTask,
|
||||
addSprint,
|
||||
@ -224,7 +224,7 @@ export function SprintBoard() {
|
||||
const overId = over.id as string
|
||||
|
||||
// Check if dropped over a column
|
||||
if (statusColumns.includes(overId as any)) {
|
||||
if (statusColumns.includes(overId as SprintColumnStatus)) {
|
||||
updateTask(taskId, { status: overId as Task["status"] })
|
||||
return
|
||||
}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import * as React from "react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface TextareaProps
|
||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>
|
||||
|
||||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
({ className, ...props }, ref) => {
|
||||
|
||||
@ -485,21 +485,23 @@ const normalizeCommentAuthor = (value: unknown): CommentAuthor => {
|
||||
const normalizeComments = (value: unknown): Comment[] => {
|
||||
if (!Array.isArray(value)) return []
|
||||
|
||||
return value
|
||||
.map((entry) => {
|
||||
if (!entry || typeof entry !== 'object') return null
|
||||
const candidate = entry as Partial<Comment>
|
||||
if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') return null
|
||||
const comments: Comment[] = []
|
||||
|
||||
for (const entry of value) {
|
||||
if (!entry || typeof entry !== 'object') continue
|
||||
const candidate = entry as Partial<Comment>
|
||||
if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') continue
|
||||
|
||||
return {
|
||||
id: candidate.id,
|
||||
text: candidate.text,
|
||||
createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(),
|
||||
author: normalizeCommentAuthor(candidate.author),
|
||||
replies: normalizeComments(candidate.replies),
|
||||
}
|
||||
comments.push({
|
||||
id: candidate.id,
|
||||
text: candidate.text,
|
||||
createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(),
|
||||
author: normalizeCommentAuthor(candidate.author),
|
||||
replies: normalizeComments(candidate.replies),
|
||||
})
|
||||
.filter((comment): comment is Comment => comment !== null)
|
||||
}
|
||||
|
||||
return comments
|
||||
}
|
||||
|
||||
const normalizeAttachments = (value: unknown): TaskAttachment[] => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user