chore(frontend): 稳定增量集成的 lint 与 typecheck
This commit is contained in:
parent
036f8fb3b1
commit
87bdb58a9e
|
|
@ -9,6 +9,7 @@ export default tseslint.config(
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
".next",
|
".next",
|
||||||
|
"imports/**",
|
||||||
"src/components/ui/**",
|
"src/components/ui/**",
|
||||||
"src/components/ai-elements/**",
|
"src/components/ai-elements/**",
|
||||||
"*.js",
|
"*.js",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { Message } from "@langchain/langgraph-sdk";
|
|
||||||
import type { UseStream } from "@langchain/langgraph-sdk/react";
|
import type { UseStream } from "@langchain/langgraph-sdk/react";
|
||||||
import { FilesIcon, ListTodoIcon, XIcon } from "lucide-react";
|
import { FilesIcon, ListTodoIcon, XIcon } from "lucide-react";
|
||||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||||
|
|
@ -356,7 +355,7 @@ export default function ChatPage() {
|
||||||
suppressExistingThreadPrefetchUi
|
suppressExistingThreadPrefetchUi
|
||||||
? []
|
? []
|
||||||
: !thread.isLoading && finalState?.messages
|
: !thread.isLoading && finalState?.messages
|
||||||
? (finalState.messages as Message[])
|
? finalState.messages
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
paddingBottom={todoListCollapsed ? 160 : 280}
|
paddingBottom={todoListCollapsed ? 160 : 280}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ export function IframeTestPanel() {
|
||||||
|
|
||||||
function handleTestClipboardCopy() {
|
function handleTestClipboardCopy() {
|
||||||
const testText = "测试复制内容 - " + new Date().toISOString();
|
const testText = "测试复制内容 - " + new Date().toISOString();
|
||||||
copyToClipboard(testText);
|
void copyToClipboard(testText);
|
||||||
addLog(`copyToClipboard → "${testText.slice(0, 30)}..."`);
|
addLog(`copyToClipboard → "${testText.slice(0, 30)}..."`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export function getVisualWidth(text: string): number {
|
||||||
* 例如: "very-long-file-name.txt" -> "very-lon...me.txt"
|
* 例如: "very-long-file-name.txt" -> "very-lon...me.txt"
|
||||||
* 中文按视觉宽度计算(中文算2,英文算1)
|
* 中文按视觉宽度计算(中文算2,英文算1)
|
||||||
*/
|
*/
|
||||||
export function truncateMiddle(text: string, maxVisualWidth: number = 30): string {
|
export function truncateMiddle(text: string, maxVisualWidth = 30): string {
|
||||||
const visualWidth = getVisualWidth(text);
|
const visualWidth = getVisualWidth(text);
|
||||||
if (visualWidth <= maxVisualWidth) return text;
|
if (visualWidth <= maxVisualWidth) return text;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@
|
||||||
"**/*.tsx",
|
"**/*.tsx",
|
||||||
"**/*.cjs",
|
"**/*.cjs",
|
||||||
"**/*.js",
|
"**/*.js",
|
||||||
".next/types/**/*.ts",
|
".next/types/**/*.ts"
|
||||||
".next/dev/types/**/*.ts"
|
|
||||||
],
|
],
|
||||||
"exclude": ["node_modules", "generated", "imports"]
|
"exclude": ["node_modules", "generated", "imports"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue