Skip to content

Commit 18bffa9

Browse files
committed
fix: resolve all lint errors
1 parent 3bc7765 commit 18bffa9

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

app/(chat)/api/chat/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { checkBotId } from "botid/server";
21
import { geolocation, ipAddress } from "@vercel/functions";
32
import {
43
convertToModelMessages,
@@ -8,12 +7,13 @@ import {
87
stepCountIs,
98
streamText,
109
} from "ai";
10+
import { checkBotId } from "botid/server";
1111
import { after } from "next/server";
1212
import { createResumableStreamContext } from "resumable-stream";
1313
import { auth, type UserType } from "@/app/(auth)/auth";
1414
import { entitlementsByUserType } from "@/lib/ai/entitlements";
15-
import { type RequestHints, systemPrompt } from "@/lib/ai/prompts";
1615
import { allowedModelIds } from "@/lib/ai/models";
16+
import { type RequestHints, systemPrompt } from "@/lib/ai/prompts";
1717
import { getLanguageModel } from "@/lib/ai/providers";
1818
import { createDocument } from "@/lib/ai/tools/create-document";
1919
import { getWeather } from "@/lib/ai/tools/get-weather";
@@ -185,7 +185,7 @@ export async function POST(request: Request) {
185185
});
186186

187187
dataStream.merge(
188-
result.toUIMessageStream({ sendReasoning: isReasoningModel }),
188+
result.toUIMessageStream({ sendReasoning: isReasoningModel })
189189
);
190190

191191
if (titlePromise) {
@@ -236,7 +236,7 @@ export async function POST(request: Request) {
236236
if (
237237
error instanceof Error &&
238238
error.message?.includes(
239-
"AI Gateway requires a valid credit card on file to service requests",
239+
"AI Gateway requires a valid credit card on file to service requests"
240240
)
241241
) {
242242
return "AI Gateway requires a valid credit card on file to service requests. Please visit https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dadd-credit-card to add a card and unlock your free credits.";

components/ai-elements/web-preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@ export const WebPreviewConsole = ({
238238
{logs.length === 0 ? (
239239
<p className="text-muted-foreground">No console output</p>
240240
) : (
241-
logs.map((log, index) => (
241+
logs.map((log) => (
242242
<div
243243
className={cn(
244244
"text-xs",
245245
log.level === "error" && "text-destructive",
246246
log.level === "warn" && "text-yellow-600",
247247
log.level === "log" && "text-foreground"
248248
)}
249-
key={`${log.timestamp.getTime()}-${index}`}
249+
key={`${log.timestamp.getTime()}-${log.message}`}
250250
>
251251
<span className="text-muted-foreground">
252252
{log.timestamp.toLocaleTimeString()}

components/console.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ export function Console({ consoleOutputs, setConsoleOutputs }: ConsoleProps) {
162162
</div>
163163
) : (
164164
<div className="flex w-full flex-col gap-2 overflow-x-scroll text-zinc-900 dark:text-zinc-50">
165-
{consoleOutput.contents.map((content, contentIndex) =>
165+
{consoleOutput.contents.map((content) =>
166166
content.type === "image" ? (
167-
<picture key={`${consoleOutput.id}-${contentIndex}`}>
167+
<picture key={`${consoleOutput.id}-${content.value}`}>
168168
<img
169169
alt="output"
170170
className="w-full max-w-(--breakpoint-toast-mobile) rounded-md"
@@ -174,7 +174,7 @@ export function Console({ consoleOutputs, setConsoleOutputs }: ConsoleProps) {
174174
) : (
175175
<div
176176
className="w-full whitespace-pre-line break-words"
177-
key={`${consoleOutput.id}-${contentIndex}`}
177+
key={`${consoleOutput.id}-${content.value}`}
178178
>
179179
{content.value}
180180
</div>

components/elements/web-preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ export const WebPreviewConsole = ({
227227
{logs.length === 0 ? (
228228
<p className="text-muted-foreground">No console output</p>
229229
) : (
230-
logs.map((log, index) => (
230+
logs.map((log) => (
231231
<div
232232
className={cn(
233233
"text-xs",
234234
log.level === "error" && "text-destructive",
235235
log.level === "warn" && "text-yellow-600",
236236
log.level === "log" && "text-foreground"
237237
)}
238-
key={`${log.timestamp.getTime()}-${index}`}
238+
key={`${log.timestamp.getTime()}-${log.message}`}
239239
>
240240
<span className="text-muted-foreground">
241241
{log.timestamp.toLocaleTimeString()}

0 commit comments

Comments
 (0)