diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index d26eb1a..89cc6ea 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -40,7 +40,7 @@ function validateFileParts(messages: any[]): { for (const filePart of fileParts) { // Data URLs format: data:image/png;base64, // Base64 increases size by ~33%, so we check the decoded size - if (filePart.url && filePart.url.startsWith("data:")) { + if (filePart.url?.startsWith("data:")) { const base64Data = filePart.url.split(",")[1] if (base64Data) { const sizeInBytes = Math.ceil((base64Data.length * 3) / 4) diff --git a/app/page.tsx b/app/page.tsx index a45dbca..186de86 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ "use client" -import React, { useEffect, useRef, useState } from "react" +import { useEffect, useRef, useState } from "react" import { DrawIoEmbed } from "react-drawio" import type { ImperativePanelHandle } from "react-resizable-panels" import ChatPanel from "@/components/chat-panel" diff --git a/biome.json b/biome.json index 355aa06..f6e8fd9 100644 --- a/biome.json +++ b/biome.json @@ -19,6 +19,30 @@ "recommended": true, "complexity": { "noImportantStyles": "off" + }, + "suspicious": { + "noExplicitAny": "off", + "noArrayIndexKey": "off", + "noImplicitAnyLet": "off", + "noAssignInExpressions": "off" + }, + "a11y": { + "useButtonType": "off", + "noAutofocus": "off", + "noStaticElementInteractions": "off", + "useKeyWithClickEvents": "off", + "noLabelWithoutControl": "off", + "noNoninteractiveTabindex": "off" + }, + "correctness": { + "useExhaustiveDependencies": "off" + }, + "style": { + "useNodejsImportProtocol": "off", + "useTemplate": "off" + }, + "security": { + "noDangerouslySetInnerHtml": "off" } } }, diff --git a/components/chat-input.tsx b/components/chat-input.tsx index de8e7ad..f203e64 100644 --- a/components/chat-input.tsx +++ b/components/chat-input.tsx @@ -99,8 +99,8 @@ function showValidationErrors(errors: string[]) { {errors.length} files rejected: