diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 7a801cd..71c172e 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -7,7 +7,12 @@ const compat = new FlatCompat({ export default tseslint.config( { - ignores: [".next", "src/components/ui/**", "src/components/ai-elements/**"], + ignores: [ + ".next", + "src/components/ui/**", + "src/components/ai-elements/**", + "*.js", + ], }, ...compat.extends("next/core-web-vitals"), { diff --git a/frontend/package.json b/frontend/package.json index 082ab83..6e6f55a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,10 +8,8 @@ "build": "next build", "check": "next lint && tsc --noEmit", "dev": "next dev --turbo", - "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache", - "format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache", - "lint": "next lint", - "lint:fix": "next lint --fix", + "lint": "eslint . --ext .ts,.tsx", + "lint:fix": "eslint . --ext .ts,.tsx --fix", "preview": "next build && next start", "start": "next start", "typecheck": "tsc --noEmit" diff --git a/frontend/src/components/workspace/code-editor.tsx b/frontend/src/components/workspace/code-editor.tsx index 2004f70..84c558c 100644 --- a/frontend/src/components/workspace/code-editor.tsx +++ b/frontend/src/components/workspace/code-editor.tsx @@ -2,7 +2,7 @@ import { css } from "@codemirror/lang-css"; import { html } from "@codemirror/lang-html"; -import { javascript, javascriptLanguage } from "@codemirror/lang-javascript"; +import { javascript } from "@codemirror/lang-javascript"; import { json } from "@codemirror/lang-json"; import { markdown, markdownLanguage } from "@codemirror/lang-markdown"; import { python } from "@codemirror/lang-python"; @@ -13,9 +13,9 @@ import CodeMirror from "@uiw/react-codemirror"; import { useTheme } from "next-themes"; import { useMemo } from "react"; +import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; -import { Textarea } from "../ui/textarea"; import { useThread } from "./messages/context"; const customDarkTheme = monokaiInit({ settings: { @@ -49,7 +49,7 @@ export function CodeEditor({ readonly?: boolean; disabled?: boolean; autoFocus?: boolean; - settings?: any; + settings?: unknown; }) { const { thread: { isLoading }, @@ -98,10 +98,12 @@ export function CodeEditor({ theme={resolvedTheme === "dark" ? customDarkTheme : customLightTheme} extensions={extensions} basicSetup={{ - foldGutter: settings?.foldGutter ?? false, + foldGutter: + (settings as { foldGutter?: boolean })?.foldGutter ?? false, highlightActiveLine: false, highlightActiveLineGutter: false, - lineNumbers: settings?.lineNumbers ?? false, + lineNumbers: + (settings as { lineNumbers?: boolean })?.lineNumbers ?? false, }} autoFocus={autoFocus} value={value} diff --git a/frontend/src/components/workspace/messages/message-list-item.tsx b/frontend/src/components/workspace/messages/message-list-item.tsx index c9b094f..dc516a0 100644 --- a/frontend/src/components/workspace/messages/message-list-item.tsx +++ b/frontend/src/components/workspace/messages/message-list-item.tsx @@ -1,5 +1,5 @@ import type { Message } from "@langchain/langgraph-sdk"; -import { ExternalLinkIcon, FileIcon, LinkIcon } from "lucide-react"; +import { ExternalLinkIcon, FileIcon } from "lucide-react"; import { useParams } from "next/navigation"; import { memo, useMemo } from "react"; import rehypeKatex from "rehype-katex"; @@ -409,73 +409,6 @@ function UploadedFileCard({ ); } -/** - * Citations list component that displays all sources at the top - */ -function CitationsList({ citations }: { citations: Citation[] }) { - if (citations.length === 0) return null; - - return ( -
-
- - Sources ({citations.length}) -
-
- {citations.map((citation) => ( - - ))} -
-
- ); -} - -/** - * Single citation badge in the citations list - */ -function CitationBadge({ citation }: { citation: Citation }) { - const domain = extractDomainFromUrl(citation.url); - - return ( - - - - - {domain} - - - - - -
- - - Visit source - - -
-
-
- ); -} - /** * Citation link component that renders as a hover card badge */ diff --git a/frontend/src/core/uploads/api.ts b/frontend/src/core/uploads/api.ts index dbef07d..3572551 100644 --- a/frontend/src/core/uploads/api.ts +++ b/frontend/src/core/uploads/api.ts @@ -51,8 +51,10 @@ export async function uploadFiles( ); if (!response.ok) { - const error = await response.json().catch(() => ({ detail: "Upload failed" })); - throw new Error(error.detail || "Upload failed"); + const error = await response + .json() + .catch(() => ({ detail: "Upload failed" })); + throw new Error(error.detail ?? "Upload failed"); } return response.json();