Compare commits

...

1 Commits

Author SHA1 Message Date
yyh
1c60bc71c4 refactor: clear small lint suppression scopes 2026-09-22 12:01:45 +08:00
9 changed files with 11 additions and 53 deletions

View File

@@ -168,7 +168,6 @@ describe('E2E / JSON & YAML output format (spec 5.2)', () => {
// the JSON error envelope always has the same top-level structure.
const unauthTmp = await withTempConfig()
let envelope1: ReturnType<typeof assertErrorEnvelope>
let envelope2: ReturnType<typeof assertErrorEnvelope>
try {
// Scenario A: unauthenticated → not_logged_in (error in stderr)
const { run: runFn } = await import('../../helpers/cli.js')
@@ -181,7 +180,7 @@ describe('E2E / JSON & YAML output format (spec 5.2)', () => {
// Scenario B: non-existent app → server error (error in stderr when -o json)
const r2 = await fx.r(['get', 'app', 'nonexistent-app-id-00000000', '-o', 'json'])
assertNonZeroExit(r2)
envelope2 = assertErrorEnvelope(r2)
const envelope2 = assertErrorEnvelope(r2)
// Both envelopes must share the same schema structure
expect(envelope1.error).toHaveProperty('code')

View File

@@ -4,11 +4,6 @@
"count": 1
}
},
"cli/test/e2e/suites/output/json-yaml-output.e2e.ts": {
"prefer-const": {
"count": 1
}
},
"packages/migrate-no-unchecked-indexed-access/src/no-unchecked-indexed-access/migrate.ts": {
"no-console": {
"count": 11
@@ -260,9 +255,6 @@
}
},
"web/app/components/app/configuration/config-var/config-modal/__tests__/form-fields.spec.tsx": {
"no-unused-vars": {
"count": 1
},
"typescript/no-explicit-any": {
"count": 1
}
@@ -609,11 +601,6 @@
"count": 2
}
},
"web/app/components/app/type-selector/index.tsx": {
"unicorn/prefer-includes": {
"count": 2
}
},
"web/app/components/app/workflow-log/__tests__/list.spec.tsx": {
"typescript/no-explicit-any": {
"count": 1
@@ -668,11 +655,6 @@
"count": 2
}
},
"web/app/components/base/app-icon-picker/ImageInput.tsx": {
"eslint-react/no-create-ref": {
"count": 1
}
},
"web/app/components/base/audio-btn/audio.player.manager.ts": {
"dify/require-disable-directive-description": {
"count": 1
@@ -901,9 +883,6 @@
}
},
"web/app/components/base/error-boundary/index.tsx": {
"eslint-react/jsx-no-key-after-spread": {
"count": 1
},
"react/only-export-components": {
"count": 1
},
@@ -3426,9 +3405,6 @@
"web/app/components/workflow/nodes/_base/components/variable/variable-label/hooks.ts": {
"eslint-react/no-unnecessary-use-prefix": {
"count": 2
},
"eslint-react/use-memo": {
"count": 2
}
},
"web/app/components/workflow/nodes/_base/components/variable/variable-label/index.tsx": {
@@ -3513,9 +3489,6 @@
}
},
"web/app/components/workflow/nodes/agent/node.tsx": {
"eslint-react/jsx-no-key-after-spread": {
"count": 2
},
"typescript/no-explicit-any": {
"count": 2
}
@@ -4660,9 +4633,6 @@
"web/app/components/workflow/workflow-generator/example-prompts.tsx": {
"dify/require-disable-directive-description": {
"count": 1
},
"no-useless-return": {
"count": 1
}
},
"web/app/components/workflow/workflow-generator/index.tsx": {

View File

@@ -7,7 +7,6 @@ import ConfigModalFormFields from '../form-fields'
vi.mock('react-i18next', async () => {
const { withSelectorKey, withSelectorKeyProps } = await import('@/test/i18n-mock')
const React = await import('react')
return {
useTranslation: () => ({
t: withSelectorKey((key: string, options?: Record<string, unknown>) => {

View File

@@ -68,10 +68,10 @@ const AppTypeSelector = ({ value, onChange }: AppSelectorProps) => {
<AppTypeSelectorItem
key={mode}
type={mode}
checked={Boolean(value.length > 0 && value?.indexOf(mode) !== -1)}
checked={value.includes(mode)}
onClick={() => {
if (value?.indexOf(mode) !== -1) onChange(value?.filter((v) => v !== mode) ?? [])
else onChange([...(value || []), mode])
if (value.includes(mode)) onChange(value.filter((v) => v !== mode))
else onChange([...value, mode])
}}
/>
))}

View File

@@ -3,7 +3,7 @@
import type { ChangeEvent, FC } from 'react'
import type { Area, CropperProps } from 'react-easy-crop'
import { cn } from '@langgenius/dify-ui/cn'
import { createRef, useEffect, useState } from 'react'
import { useEffect, useRef, useState } from 'react'
import Cropper from 'react-easy-crop'
import { useTranslation } from 'react-i18next'
import { ALLOW_FILE_EXTENSIONS } from '@/types/app'
@@ -54,7 +54,7 @@ const ImageInput: FC<UploaderProps> = ({ className, cropShape, onImageInput }) =
const { isDragActive, handleDragEnter, handleDragOver, handleDragLeave, handleDrop } =
useDraggableUploader((file: File) => setInputImage({ file, url: URL.createObjectURL(file) }))
const inputRef = createRef<HTMLInputElement>()
const inputRef = useRef<HTMLInputElement>(null)
const handleShowImage = () => {
if (isAnimatedImage) {

View File

@@ -220,9 +220,9 @@ const ErrorBoundary: React.FC<ErrorBoundaryProps> = (props) => {
return (
<ErrorBoundaryInner
key={errorBoundaryKey}
{...props}
copy={copy}
key={errorBoundaryKey}
resetErrorBoundary={resetErrorBoundary}
onResetKeysChange={onResetKeysChange}
/>

View File

@@ -64,12 +64,9 @@ export const useVarColor = (
export const useVarName = (variables: string[], notShowFullPath?: boolean) => {
const showName = VAR_SHOW_NAME_MAP[variables.join('.')]
let variableFullPathName = variables.slice(1).join('.')
if (isRagVariableVar(variables)) variableFullPathName = variables.slice(2).join('.')
const varName = useMemo(() => {
variableFullPathName = variables.slice(1).join('.')
let variableFullPathName = variables.slice(1).join('.')
if (isRagVariableVar(variables)) variableFullPathName = variables.slice(2).join('.')

View File

@@ -108,7 +108,7 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
}
>
{models.map((model) => {
return <ModelBar {...model} key={model.param} />
return <ModelBar key={model.param} {...model} />
})}
</Group>
)}
@@ -122,7 +122,7 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
>
<div className="grid grid-cols-10 gap-0.5">
{tools.map((tool, i) => (
<ToolIcon {...tool} key={tool.id + i} />
<ToolIcon key={tool.id + i} {...tool} />
))}
</div>
</Group>

View File

@@ -21,12 +21,6 @@ const SKELETONS = [
{ id: 'wide', width: 120 },
] as const
// AbortController throws a DOMException in modern browsers and a plain Error in
// older / non-DOM environments — accept both so a user-triggered abort (modal
// close / regenerate) never surfaces as an error.
const isAbortError = (e: unknown): boolean =>
(e instanceof DOMException || e instanceof Error) && e.name === 'AbortError'
/**
* "Ideas for you" chips under the instruction textarea.
*
@@ -81,8 +75,7 @@ const ExamplePrompts = ({ mode, onSelect }: Props) => {
const next = (res?.suggestions ?? []).map((s) => s.trim()).filter(Boolean)
// Keep the previous set on an empty refresh so the row never flashes empty.
if (next.length) setCached(next)
} catch (e) {
if (isAbortError(e)) return
} catch {
// Silent: the static fallback keeps the row populated.
} finally {
setIsLoading(false)