fix: fix eslint errors and warnings

This commit is contained in:
Henry Li
2026-01-31 21:46:31 +08:00
parent cf961328a9
commit d3ff5f9d3c
5 changed files with 20 additions and 80 deletions

View File

@@ -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}