chore: lint require and how to import react (#30041)

This commit is contained in:
Stephen Zhou
2025-12-23 18:02:10 +08:00
committed by GitHub
parent 72ca3607a3
commit 403adefc07
1078 changed files with 1680 additions and 1216 deletions

View File

@ -3,7 +3,7 @@ import type { FC } from 'react'
import {
RiAddLine,
} from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import Button from '@/app/components/base/button'
import { cn } from '@/utils/classnames'

View File

@ -1,6 +1,7 @@
'use client'
import type { FC } from 'react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Checkbox from '@/app/components/base/checkbox'

View File

@ -6,7 +6,8 @@ import {
RiDeleteBinLine,
} from '@remixicon/react'
import { produce } from 'immer'
import React, { useCallback, useMemo } from 'react'
import * as React from 'react'
import { useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader'
import { Line3 } from '@/app/components/base/icons/src/public/common'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { InputVar } from '../../../../types'
import { produce } from 'immer'
import React, { useCallback, useEffect, useMemo, useRef } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useMemo, useRef } from 'react'
import AddButton from '@/app/components/base/button/add-button'
import { RETRIEVAL_OUTPUT_STRUCT } from '@/app/components/workflow/constants'
import { InputVarType } from '@/app/components/workflow/types'

View File

@ -4,7 +4,8 @@ import type { Props as FormProps } from './form'
import type { Emoji } from '@/app/components/tools/types'
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type { BlockEnum, NodeRunningStatus } from '@/app/components/workflow/types'
import React, { useEffect, useRef } from 'react'
import * as React from 'react'
import { useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { getProcessedFiles } from '@/app/components/base/file-uploader/utils'

View File

@ -3,7 +3,7 @@ import type { FC } from 'react'
import {
RiCloseLine,
} from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
const i18nPrefix = 'workflow.singleRun'

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { CodeLanguage } from '../../code/types'
import type { GenRes } from '@/service/debug'
import { useBoolean } from 'ahooks'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { GetCodeGeneratorResModal } from '@/app/components/app/configuration/config/code-generator/get-code-generator-res'
import { ActionButton } from '@/app/components/base/action-button'
import { Generator } from '@/app/components/base/icons/src/vender/other'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { ValueSelector, Var, VisionSetting } from '@/app/components/workflow/types'
import { produce } from 'immer'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Switch from '@/app/components/base/switch'
import Tooltip from '@/app/components/base/tooltip'

View File

@ -4,7 +4,8 @@ import type { CodeLanguage } from '../../../code/types'
import type { FileEntity } from '@/app/components/base/file-uploader/types'
import type { Node, NodeOutPutVar } from '@/app/components/workflow/types'
import copy from 'copy-to-clipboard'
import React, { useCallback, useRef, useState } from 'react'
import * as React from 'react'
import { useCallback, useRef, useState } from 'react'
import PromptEditorHeightResizeWrap from '@/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap'
import ActionButton from '@/app/components/base/action-button'
import FileListInLog from '@/app/components/base/file-uploader/file-list-in-log'

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { Props as EditorProps } from '.'
import type { NodeOutPutVar, Variable } from '@/app/components/workflow/types'
import { useBoolean } from 'ahooks'
import React, { useEffect, useRef, useState } from 'react'
import * as React from 'react'
import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import VarReferenceVars from '@/app/components/workflow/nodes/_base/components/variable/var-reference-vars'
import { cn } from '@/utils/classnames'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import Editor, { loader } from '@monaco-editor/react'
import { noop } from 'lodash-es'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import * as React from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import {
getFilesInLogs,
} from '@/app/components/base/file-uploader/utils'

View File

@ -1,7 +1,8 @@
'use client'
import type { FC } from 'react'
import { useBoolean } from 'ahooks'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import Base from './base'
type Props = {

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useStore } from '@/app/components/workflow/store'
type Props = {

View File

@ -4,7 +4,7 @@ import {
RiArrowDownSLine,
} from '@remixicon/react'
import { useBoolean } from 'ahooks'
import React from 'react'
import * as React from 'react'
import Tooltip from '@/app/components/base/tooltip'
import { cn } from '@/utils/classnames'

View File

@ -1,7 +1,8 @@
'use client'
import type { FC } from 'react'
import { noop } from 'lodash-es'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Checkbox from '@/app/components/base/checkbox'
import { FileTypeIcon } from '@/app/components/base/file-uploader'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { UploadFileSetting } from '../../../types'
import { produce } from 'immer'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Field from '@/app/components/app/configuration/config-var/config-modal/field'
import { useFileSizeLimit } from '@/app/components/base/file-uploader/hooks'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC, ReactNode } from 'react'
import React from 'react'
import * as React from 'react'
type Props = {
title: string

View File

@ -1,6 +1,7 @@
'use client'
import type { FC } from 'react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import Slider from '@/app/components/base/slider'
export type InputNumberWithSliderProps = {

View File

@ -6,7 +6,8 @@ import type {
} from '@/app/components/workflow/types'
import { useBoolean } from 'ahooks'
import { noop } from 'lodash-es'
import React, { useEffect } from 'react'
import * as React from 'react'
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
import PromptEditor from '@/app/components/base/prompt-editor'

View File

@ -10,7 +10,7 @@ import {
RiHashtag,
RiTextSnippet,
} from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { InputVarType } from '../../../types'
type Props = {

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
type Props = {
children: React.ReactNode

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import { RiAlertFill } from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Tooltip from '@/app/components/base/tooltip'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { Memory } from '../../../types'
import { produce } from 'immer'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Input from '@/app/components/base/input'
import Slider from '@/app/components/base/slider'

View File

@ -2,7 +2,8 @@
import type { VariantProps } from 'class-variance-authority'
import type { FC } from 'react'
import { cva } from 'class-variance-authority'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import Tooltip from '@/app/components/base/tooltip'
import { cn } from '@/utils/classnames'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC, ReactNode } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { FieldCollapse } from '@/app/components/workflow/nodes/_base/components/collapse'
import { cn } from '@/utils/classnames'

View File

@ -11,7 +11,8 @@ import {
} from '@remixicon/react'
import { useBoolean } from 'ahooks'
import copy from 'copy-to-clipboard'
import React, { useCallback, useRef } from 'react'
import * as React from 'react'
import { useCallback, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import ActionButton from '@/app/components/base/action-button'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import {
VariableLabelInText,
} from '@/app/components/workflow/nodes/_base/components/variable/variable-label'

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import { RiDeleteBinLine } from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import ActionButton from '@/app/components/base/action-button'
type Props = {

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Confirm from '@/app/components/base/confirm'

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import { useBoolean, useClickAway } from 'ahooks'
import React from 'react'
import * as React from 'react'
import { ChevronSelectorVertical } from '@/app/components/base/icons/src/vender/line/arrows'
import { Check } from '@/app/components/base/icons/src/vender/line/general'
import { cn } from '@/utils/classnames'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { cn } from '@/utils/classnames'
type Props = {

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import VarHighlight from '@/app/components/app/configuration/base/var-highlight'
import { cn } from '@/utils/classnames'

View File

@ -4,7 +4,8 @@ import {
RiCollapseDiagonalLine,
RiExpandDiagonalLine,
} from '@remixicon/react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import ActionButton from '@/app/components/base/action-button'
type Props = {

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import type { NodeOutPutVar, ValueSelector, Var } from '@/app/components/workflow/types'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import ListEmpty from '@/app/components/base/list-empty'
import VarReferenceVars from './var-reference-vars'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { CredentialFormSchema, CredentialFormSchemaNumberInput, CredentialFormSchemaSelect } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { Var } from '@/app/components/workflow/types'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { SimpleSelect } from '@/app/components/base/select'
import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks'

View File

@ -3,7 +3,7 @@ import type { FC } from 'react'
import type { Field as FieldType } from '../../../../../llm/types'
import type { ValueSelector } from '@/app/components/workflow/types'
import { RiMoreFill } from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Tooltip from '@/app/components/base/tooltip'
import { cn } from '@/utils/classnames'

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { StructuredOutput } from '../../../../../llm/types'
import type { ValueSelector } from '@/app/components/workflow/types'
import { useHover } from 'ahooks'
import React, { useRef } from 'react'
import * as React from 'react'
import { useRef } from 'react'
import { cn } from '@/utils/classnames'
import Field from './field'

View File

@ -3,7 +3,7 @@ import type { FC } from 'react'
import type { Field as FieldType } from '../../../../../llm/types'
import { RiArrowDropDownLine } from '@remixicon/react'
import { useBoolean } from 'ahooks'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { cn } from '@/utils/classnames'
import { Type } from '../../../../../llm/types'

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import type { StructuredOutput } from '../../../../../llm/types'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Field from './field'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { cn } from '@/utils/classnames'
type Props = {

View File

@ -5,7 +5,8 @@ import type { ToastHandle } from '@/app/components/base/toast'
import type { VarType } from '@/app/components/workflow/types'
import { useDebounceFn } from 'ahooks'
import { produce } from 'immer'
import React, { useCallback, useState } from 'react'
import * as React from 'react'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Input from '@/app/components/base/input'
import Toast from '@/app/components/base/toast'

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import type { Field, StructuredOutput, TypeWithArray } from '../../../llm/types'
import React from 'react'
import * as React from 'react'
import BlockIcon from '@/app/components/workflow/block-icon'
import { PickerPanelMain as Panel } from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker'
import { BlockEnum } from '@/app/components/workflow/types'

View File

@ -5,7 +5,8 @@ import type { ValueSelector, Var, Variable } from '@/app/components/workflow/typ
import { RiDraggable } from '@remixicon/react'
import { useDebounceFn } from 'ahooks'
import { produce } from 'immer'
import React, { useCallback, useMemo, useState } from 'react'
import * as React from 'react'
import { useCallback, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { ReactSortable } from 'react-sortablejs'
import { v4 as uuid4 } from 'uuid'

View File

@ -13,7 +13,8 @@ import {
} from '@remixicon/react'
import { produce } from 'immer'
import { noop } from 'lodash-es'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
useNodes,

View File

@ -1,7 +1,8 @@
'use client'
import type { FC } from 'react'
import type { NodeOutPutVar, ValueSelector, Var } from '@/app/components/workflow/types'
import React, { useMemo } from 'react'
import * as React from 'react'
import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import ListEmpty from '@/app/components/base/list-empty'
import { useStore } from '@/app/components/workflow/store'

View File

@ -5,7 +5,8 @@ import type { Field } from '@/app/components/workflow/nodes/llm/types'
import type { NodeOutPutVar, ValueSelector, Var } from '@/app/components/workflow/types'
import { useHover } from 'ahooks'
import { noop } from 'lodash-es'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import * as React from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows'
import { CodeAssistant, MagicEdit } from '@/app/components/base/icons/src/vender/line/general'

View File

@ -1,7 +1,8 @@
'use client'
import type { FC } from 'react'
import { RiArrowDownSLine } from '@remixicon/react'
import React, { useCallback, useState } from 'react'
import * as React from 'react'
import { useCallback, useState } from 'react'
import { Check } from '@/app/components/base/icons/src/vender/line/general'
import {
PortalToFollowElem,

View File

@ -7,7 +7,8 @@ import {
RiPlayLargeLine,
} from '@remixicon/react'
import { debounce } from 'lodash-es'
import React, {
import * as React from 'react'
import {
cloneElement,
memo,
useCallback,

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { ResultPanelProps } from '@/app/components/workflow/run/result-panel'
import type { NodeTracing } from '@/types/workflow'
import { RiLoader2Line } from '@remixicon/react'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { useHooksStore } from '@/app/components/workflow/hooks-store'
import ResultPanel from '@/app/components/workflow/run/result-panel'
import { NodeRunningStatus } from '@/app/components/workflow/types'

View File

@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import { RiPlayLine } from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { ClockPlay } from '@/app/components/base/icons/src/vender/line/time'

View File

@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import TabHeader from '@/app/components/base/tab-header'