fix: update ESLint configuration and dependencies, replace zod import… (#10645)
fix: update ESLint configuration and dependencies, replace zod import style
This commit is contained in:
@@ -2,6 +2,7 @@ import tseslint from '@electron-toolkit/eslint-config-ts'
|
||||
import eslint from '@eslint/js'
|
||||
import eslintReact from '@eslint-react/eslint-plugin'
|
||||
import { defineConfig } from 'eslint/config'
|
||||
import importZod from 'eslint-plugin-import-zod'
|
||||
import oxlint from 'eslint-plugin-oxlint'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
||||
@@ -15,7 +16,8 @@ export default defineConfig([
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
'unused-imports': unusedImports
|
||||
'unused-imports': unusedImports,
|
||||
'import-zod': importZod
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
@@ -25,6 +27,7 @@ export default defineConfig([
|
||||
'simple-import-sort/exports': 'error',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'@eslint-react/no-prop-types': 'error',
|
||||
'import-zod/prefer-zod-namespace': 'error'
|
||||
}
|
||||
},
|
||||
// Configuration for ensuring compatibility with the original ESLint(8.x) rules
|
||||
|
||||
@@ -257,6 +257,7 @@
|
||||
"emoji-picker-element": "^1.22.1",
|
||||
"epub": "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-plugin-import-zod": "^1.2.0",
|
||||
"eslint-plugin-oxlint": "^1.15.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
@@ -295,7 +296,7 @@
|
||||
"notion-helper": "^1.3.22",
|
||||
"npx-scope-finder": "^1.2.0",
|
||||
"openai": "patch:openai@npm%3A5.12.2#~/.yarn/patches/openai-npm-5.12.2-30b075401c.patch",
|
||||
"oxlint": "^1.15.0",
|
||||
"oxlint": "^1.22.0",
|
||||
"oxlint-tsgolint": "^0.2.0",
|
||||
"p-queue": "^8.1.0",
|
||||
"pdf-lib": "^1.17.1",
|
||||
|
||||
@@ -13,7 +13,7 @@ import { LanguageModelV2 } from '@ai-sdk/provider'
|
||||
import { createXai } from '@ai-sdk/xai'
|
||||
import { createOpenRouter } from '@openrouter/ai-sdk-provider'
|
||||
import { customProvider, Provider } from 'ai'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* 基础 Provider IDs
|
||||
|
||||
@@ -3,7 +3,7 @@ import { loggerService } from '@logger'
|
||||
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
|
||||
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'
|
||||
import { net } from 'electron'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
const logger = loggerService.withContext('DifyKnowledgeServer')
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
|
||||
import { net } from 'electron'
|
||||
import { JSDOM } from 'jsdom'
|
||||
import TurndownService from 'turndown'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export const RequestPayloadSchema = z.object({
|
||||
url: z.url(),
|
||||
|
||||
@@ -8,7 +8,7 @@ import fs from 'fs/promises'
|
||||
import { minimatch } from 'minimatch'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
const logger = loggerService.withContext('MCP:FileSystemServer')
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
OAuthTokens
|
||||
} from '@modelcontextprotocol/sdk/shared/auth.js'
|
||||
import EventEmitter from 'events'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export interface OAuthStorageData {
|
||||
clientInfo?: OAuthClientInformation
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { loadOcrImage } from '@main/utils/ocr'
|
||||
import { ImageFileMetadata, isImageFileMetadata, OcrPpocrConfig, OcrResult, SupportedOcrFile } from '@types'
|
||||
import { net } from 'electron'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
import { OcrBaseService } from './OcrBaseService'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Assistant, KnowledgeReference } from '@renderer/types'
|
||||
import { ExtractResults, KnowledgeExtractResults } from '@renderer/utils/extract'
|
||||
import { type InferToolInput, type InferToolOutput, tool } from 'ai'
|
||||
import { isEmpty } from 'lodash'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* 知识库搜索工具
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import store from '@renderer/store'
|
||||
import { selectCurrentUserId, selectGlobalMemoryEnabled, selectMemoryConfig } from '@renderer/store/memory'
|
||||
import { type InferToolInput, type InferToolOutput, tool } from 'ai'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
import { MemoryProcessor } from '../../services/MemoryProcessor'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import WebSearchService from '@renderer/services/WebSearchService'
|
||||
import { WebSearchProvider, WebSearchProviderResponse } from '@renderer/types'
|
||||
import { ExtractResults } from '@renderer/utils/extract'
|
||||
import { type InferToolInput, type InferToolOutput, tool } from 'ai'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* 使用预提取关键词的网络搜索工具
|
||||
|
||||
@@ -2,7 +2,7 @@ import Favicon from '@renderer/components/Icons/FallbackFavicon'
|
||||
import { Tooltip } from 'antd'
|
||||
import React, { memo, useCallback, useMemo } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export const CitationSchema = z.object({
|
||||
url: z.url(),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* WARNING: Any null value will be converted to undefined from api.
|
||||
*/
|
||||
import { ModelMessage, TextStreamPart } from 'ai'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
import type { Message, MessageBlock } from './newMessage'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Model } from '@types'
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
import { ProviderTypeSchema } from './provider'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Model } from '@types'
|
||||
import z from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export const ProviderTypeSchema = z.enum([
|
||||
'openai',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export type ToolType = 'builtin' | 'provider' | 'mcp'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
export const freshnessOptions = ['oneDay', 'oneWeek', 'oneMonth', 'oneYear', 'noLimit'] as const
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ import {
|
||||
import { InvalidToolInputError, NoSuchToolError } from 'ai'
|
||||
import { AxiosError, isAxiosError } from 'axios'
|
||||
import { t } from 'i18next'
|
||||
import { z, ZodError } from 'zod'
|
||||
import * as z from 'zod'
|
||||
import { ZodError } from 'zod'
|
||||
|
||||
import { parseJSON } from './json'
|
||||
import { safeSerialize } from './serialize'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod'
|
||||
import * as z from 'zod'
|
||||
|
||||
// Define Zod schema for fact retrieval output
|
||||
export const FactRetrievalSchema = z.object({
|
||||
|
||||
85
yarn.lock
85
yarn.lock
@@ -7815,58 +7815,58 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/darwin-arm64@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/darwin-arm64@npm:1.15.0"
|
||||
"@oxlint/darwin-arm64@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/darwin-arm64@npm:1.22.0"
|
||||
conditions: os=darwin & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/darwin-x64@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/darwin-x64@npm:1.15.0"
|
||||
"@oxlint/darwin-x64@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/darwin-x64@npm:1.22.0"
|
||||
conditions: os=darwin & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/linux-arm64-gnu@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/linux-arm64-gnu@npm:1.15.0"
|
||||
"@oxlint/linux-arm64-gnu@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/linux-arm64-gnu@npm:1.22.0"
|
||||
conditions: os=linux & cpu=arm64 & libc=glibc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/linux-arm64-musl@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/linux-arm64-musl@npm:1.15.0"
|
||||
"@oxlint/linux-arm64-musl@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/linux-arm64-musl@npm:1.22.0"
|
||||
conditions: os=linux & cpu=arm64 & libc=musl
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/linux-x64-gnu@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/linux-x64-gnu@npm:1.15.0"
|
||||
"@oxlint/linux-x64-gnu@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/linux-x64-gnu@npm:1.22.0"
|
||||
conditions: os=linux & cpu=x64 & libc=glibc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/linux-x64-musl@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/linux-x64-musl@npm:1.15.0"
|
||||
"@oxlint/linux-x64-musl@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/linux-x64-musl@npm:1.22.0"
|
||||
conditions: os=linux & cpu=x64 & libc=musl
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/win32-arm64@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/win32-arm64@npm:1.15.0"
|
||||
"@oxlint/win32-arm64@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/win32-arm64@npm:1.22.0"
|
||||
conditions: os=win32 & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/win32-x64@npm:1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "@oxlint/win32-x64@npm:1.15.0"
|
||||
"@oxlint/win32-x64@npm:1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "@oxlint/win32-x64@npm:1.22.0"
|
||||
conditions: os=win32 & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
@@ -14423,6 +14423,7 @@ __metadata:
|
||||
emoji-picker-element: "npm:^1.22.1"
|
||||
epub: "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch"
|
||||
eslint: "npm:^9.22.0"
|
||||
eslint-plugin-import-zod: "npm:^1.2.0"
|
||||
eslint-plugin-oxlint: "npm:^1.15.0"
|
||||
eslint-plugin-react-hooks: "npm:^5.2.0"
|
||||
eslint-plugin-simple-import-sort: "npm:^12.1.1"
|
||||
@@ -14467,7 +14468,7 @@ __metadata:
|
||||
officeparser: "npm:^4.2.0"
|
||||
openai: "patch:openai@npm%3A5.12.2#~/.yarn/patches/openai-npm-5.12.2-30b075401c.patch"
|
||||
os-proxy-config: "npm:^1.1.2"
|
||||
oxlint: "npm:^1.15.0"
|
||||
oxlint: "npm:^1.22.0"
|
||||
oxlint-tsgolint: "npm:^0.2.0"
|
||||
p-queue: "npm:^8.1.0"
|
||||
pdf-lib: "npm:^1.17.1"
|
||||
@@ -18590,6 +18591,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-import-zod@npm:^1.2.0":
|
||||
version: 1.2.0
|
||||
resolution: "eslint-plugin-import-zod@npm:1.2.0"
|
||||
peerDependencies:
|
||||
"@typescript-eslint/utils": ^8.35.1
|
||||
eslint: ">=9"
|
||||
checksum: 10c0/c03f3059c4e55fa50ad43da6db989bb4c51c6466ab17bd7ec7d096421d060a20488ee1ef0df80fa61706ad0b6a4534622540ceab0638d3b6887df7d810ef1d22
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-oxlint@npm:^1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "eslint-plugin-oxlint@npm:1.15.0"
|
||||
@@ -24597,18 +24608,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"oxlint@npm:^1.15.0":
|
||||
version: 1.15.0
|
||||
resolution: "oxlint@npm:1.15.0"
|
||||
"oxlint@npm:^1.22.0":
|
||||
version: 1.22.0
|
||||
resolution: "oxlint@npm:1.22.0"
|
||||
dependencies:
|
||||
"@oxlint/darwin-arm64": "npm:1.15.0"
|
||||
"@oxlint/darwin-x64": "npm:1.15.0"
|
||||
"@oxlint/linux-arm64-gnu": "npm:1.15.0"
|
||||
"@oxlint/linux-arm64-musl": "npm:1.15.0"
|
||||
"@oxlint/linux-x64-gnu": "npm:1.15.0"
|
||||
"@oxlint/linux-x64-musl": "npm:1.15.0"
|
||||
"@oxlint/win32-arm64": "npm:1.15.0"
|
||||
"@oxlint/win32-x64": "npm:1.15.0"
|
||||
"@oxlint/darwin-arm64": "npm:1.22.0"
|
||||
"@oxlint/darwin-x64": "npm:1.22.0"
|
||||
"@oxlint/linux-arm64-gnu": "npm:1.22.0"
|
||||
"@oxlint/linux-arm64-musl": "npm:1.22.0"
|
||||
"@oxlint/linux-x64-gnu": "npm:1.22.0"
|
||||
"@oxlint/linux-x64-musl": "npm:1.22.0"
|
||||
"@oxlint/win32-arm64": "npm:1.22.0"
|
||||
"@oxlint/win32-x64": "npm:1.22.0"
|
||||
peerDependencies:
|
||||
oxlint-tsgolint: ">=0.2.0"
|
||||
dependenciesMeta:
|
||||
@@ -24634,7 +24645,7 @@ __metadata:
|
||||
bin:
|
||||
oxc_language_server: bin/oxc_language_server
|
||||
oxlint: bin/oxlint
|
||||
checksum: 10c0/3eb2a27b972f2a02200b068345ab6a3a17f7bc29c4546c6b3478727388d8d59b94a554f9b6bb1320b71a75cc598b728de0ffee5e4e70ac27457104b8efebb257
|
||||
checksum: 10c0/652c93b9360ea66c7ee87f649a56ba2b8eddc5e32494a53a61ca86749d87ce2be354960e135a60ab7054105e6b187e9d4ec56959cdb02d517423c23d6a523894
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user