feat: migrate ESLint to v9 flat config

- Replace .eslintrc.json with eslint.config.mjs
- Simplify configuration using @antfu/eslint-config
- Add necessary ESLint plugin dependencies
- Disable overly strict style rules
- Set package.json type to module for ESM support
- Fix ESLint disable comment format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
lyzno1
2025-09-10 22:21:17 +08:00
parent 2b1882a5e3
commit 05dcfcf0ca
85 changed files with 464 additions and 502 deletions

View File

@ -2,7 +2,7 @@ import type { Annotation } from './log'
import type { Locale } from '@/i18n'
import type { ThoughtItem } from '@/app/components/chat/type'
export type PromptVariable = {
export interface PromptVariable {
key: string
name: string
type: string
@ -15,19 +15,19 @@ export type PromptVariable = {
allowed_file_upload_methods?: TransferMethod[]
}
export type PromptConfig = {
export interface PromptConfig {
prompt_template: string
prompt_variables: PromptVariable[]
}
export type TextTypeFormItem = {
export interface TextTypeFormItem {
label: string
variable: string
required: boolean
max_length: number
}
export type SelectTypeFormItem = {
export interface SelectTypeFormItem {
label: string
variable: string
required: boolean
@ -39,26 +39,26 @@ export type SelectTypeFormItem = {
export type UserInputFormItem = {
'text-input': TextTypeFormItem
} | {
'select': SelectTypeFormItem
select: SelectTypeFormItem
} | {
'paragraph': TextTypeFormItem
paragraph: TextTypeFormItem
}
export const MessageRatings = ['like', 'dislike', null] as const
export type MessageRating = typeof MessageRatings[number]
export type Feedbacktype = {
export interface Feedbacktype {
rating: MessageRating
content?: string | null
}
export type MessageMore = {
export interface MessageMore {
time: string
tokens: number
latency: number | string
}
export type IChatItem = {
export interface IChatItem {
id: string
content: string
/**
@ -85,7 +85,7 @@ export type IChatItem = {
useCurrentUserAvatar?: boolean
isOpeningStatement?: boolean
suggestedQuestions?: string[]
log?: { role: string; text: string }[]
log?: { role: string, text: string }[]
agent_thoughts?: ThoughtItem[]
message_files?: VisionFile[]
}
@ -96,17 +96,17 @@ export type ChatItem = IChatItem & {
workflowProcess?: WorkflowProcess
}
export type ResponseHolder = {}
export interface ResponseHolder {}
export type ConversationItem = {
export interface ConversationItem {
id: string
name: string
inputs: Record<string, any> | null
introduction: string,
introduction: string
suggested_questions?: string[]
}
export type AppInfo = {
export interface AppInfo {
title: string
description: string
default_language: Locale
@ -125,7 +125,7 @@ export enum TransferMethod {
remote_url = 'remote_url',
}
export type VisionSettings = {
export interface VisionSettings {
enabled: boolean
number_limits: number
detail: Resolution
@ -133,7 +133,7 @@ export type VisionSettings = {
image_file_size_limit?: number | string
}
export type ImageFile = {
export interface ImageFile {
type: TransferMethod
_id: string
fileId: string
@ -144,7 +144,7 @@ export type ImageFile = {
deleted?: boolean
}
export type VisionFile = {
export interface VisionFile {
id?: string
type: string
transfer_method: TransferMethod
@ -168,7 +168,7 @@ export enum BlockEnum {
Tool = 'tool',
}
export type NodeTracing = {
export interface NodeTracing {
id: string
index: number
predecessor_node_id: string
@ -213,7 +213,7 @@ export enum WorkflowRunningStatus {
Stopped = 'stopped',
}
export type WorkflowProcess = {
export interface WorkflowProcess {
status: WorkflowRunningStatus
tracing: NodeTracing[]
expand?: boolean // for UI