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

@ -1,7 +1,8 @@
'use client'
import type { FC } from 'react'
import type { ModelConfig, PromptItem, Variable } from '../../../types'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Tooltip from '@/app/components/base/tooltip'
import Editor from '@/app/components/workflow/nodes/_base/components/prompt/editor'

View File

@ -2,7 +2,8 @@
import type { FC } from 'react'
import type { ModelConfig, PromptItem, ValueSelector, Var, Variable } 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 { ReactSortable } from 'react-sortablejs'
import { v4 as uuid4 } from 'uuid'

View File

@ -2,7 +2,8 @@ import type { FC } from 'react'
import { Editor } from '@monaco-editor/react'
import { RiClipboardLine, RiIndentIncrease } from '@remixicon/react'
import copy from 'copy-to-clipboard'
import React, { useCallback, useEffect, useMemo, useRef } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useMemo, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import Tooltip from '@/app/components/base/tooltip'
import useTheme from '@/hooks/use-theme'

View File

@ -1,6 +1,6 @@
import type { FC } from 'react'
import { RiErrorWarningFill } from '@remixicon/react'
import React from 'react'
import * as React from 'react'
import { cn } from '@/utils/classnames'
type ErrorMessageProps = {

View File

@ -1,6 +1,6 @@
import type { FC } from 'react'
import type { SchemaRoot } from '../../types'
import React from 'react'
import * as React from 'react'
import Modal from '../../../../../base/modal'
import JsonSchemaConfig from './json-schema-config'

View File

@ -1,6 +1,7 @@
import type { FC } from 'react'
import { RiCloseLine } from '@remixicon/react'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger } from '@/app/components/base/portal-to-follow-elem'

View File

@ -1,7 +1,8 @@
import type { FC } from 'react'
import type { SchemaRoot } from '../../types'
import { RiBracesLine, RiCloseLine, RiExternalLinkLine, RiTimelineView } from '@remixicon/react'
import React, { useCallback, useState } from 'react'
import * as React from 'react'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import Divider from '@/app/components/base/divider'

View File

@ -1,7 +1,8 @@
import type { FC } from 'react'
import type { SchemaRoot } from '../../../types'
import { RiArrowLeftLine, RiCloseLine, RiSparklingLine } from '@remixicon/react'
import React, { useCallback, useMemo, useState } from 'react'
import * as React from 'react'
import { useCallback, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import Loading from '@/app/components/base/loading'

View File

@ -2,7 +2,8 @@ import type { FC } from 'react'
import type { SchemaRoot } from '../../../types'
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { CompletionParams, Model } from '@/types/app'
import React, { useCallback, useEffect, useState } from 'react'
import * as React from 'react'
import { useCallback, useEffect, useState } from 'react'
import {
PortalToFollowElem,
PortalToFollowElemContent,

View File

@ -2,7 +2,8 @@ import type { FC } from 'react'
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { Model } from '@/types/app'
import { RiCloseLine, RiSparklingFill } from '@remixicon/react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import Textarea from '@/app/components/base/textarea'

View File

@ -1,5 +1,5 @@
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import LargeDataAlert from '@/app/components/workflow/variable-inspect/large-data-alert'
import { cn } from '@/utils/classnames'
import CodeEditor from './code-editor'

View File

@ -1,5 +1,6 @@
import { RiAddCircleFill } from '@remixicon/react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { useMittContext } from './context'

View File

@ -1,5 +1,5 @@
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
type CardProps = {

View File

@ -1,6 +1,6 @@
import type { FC } from 'react'
import { RiAddCircleLine, RiDeleteBinLine, RiEditLine } 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

@ -1,6 +1,6 @@
import type { FC } from 'react'
import { useKeyPress } from 'ahooks'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { getKeyboardKeyCodeBySystem, getKeyboardKeyNameBySystem } from '@/app/components/workflow/utils'

View File

@ -1,5 +1,6 @@
import type { FC } from 'react'
import React, { useCallback, useState } from 'react'
import * as React from 'react'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Divider from '@/app/components/base/divider'
import Textarea from '@/app/components/base/textarea'

View File

@ -1,5 +1,6 @@
import type { FC } from 'react'
import React, { useEffect, useState } from 'react'
import * as React from 'react'
import { useEffect, useState } from 'react'
import { cn } from '@/utils/classnames'
type AutoWidthInputProps = {

View File

@ -3,7 +3,8 @@ import type { SchemaEnumType } from '../../../../types'
import type { AdvancedOptionsType } from './advanced-options'
import type { TypeItem } from './type-selector'
import { useUnmount } from 'ahooks'
import React, { useCallback, useMemo, useRef, useState } from 'react'
import * as React from 'react'
import { useCallback, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Divider from '@/app/components/base/divider'
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'

View File

@ -1,5 +1,5 @@
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Switch from '@/app/components/base/switch'

View File

@ -2,7 +2,8 @@ import type { FC } from 'react'
import type { Field } from '../../../types'
import { RiArrowDropDownLine, RiArrowDropRightLine } from '@remixicon/react'
import { useDebounceFn } from 'ahooks'
import React, { useMemo, useState } from 'react'
import * as React from 'react'
import { useMemo, useState } from 'react'
import Divider from '@/app/components/base/divider'
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
import { cn } from '@/utils/classnames'

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { ModelConfig } from '@/app/components/workflow/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 GetAutomaticResModal from '@/app/components/app/configuration/config/automatic/get-automatic-res'
import { ActionButton } from '@/app/components/base/action-button'
import { Generator } from '@/app/components/base/icons/src/vender/other'

View File

@ -1,5 +1,5 @@
import type { FC } from 'react'
import React from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Switch from '@/app/components/base/switch'
import Field from '@/app/components/workflow/nodes/_base/components/field'

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 OptionCard from '@/app/components/workflow/nodes/_base/components/option-card'
import { Resolution } from '@/types/app'

View File

@ -3,7 +3,8 @@ import type { FC } from 'react'
import type { SchemaRoot, StructuredOutput } from '../types'
import { RiEditLine } from '@remixicon/react'
import { useBoolean } from 'ahooks'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import ShowPanel from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show'

View File

@ -1,7 +1,7 @@
import type { FC } from 'react'
import type { LLMNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types'
import React from 'react'
import * as React from 'react'
import {
useTextGenerationCurrentProviderAndModelAndModelList,
} from '@/app/components/header/account-setting/model-provider-page/hooks'

View File

@ -2,7 +2,8 @@ import type { FC } from 'react'
import type { LLMNodeType } from './types'
import type { NodePanelProps } from '@/app/components/workflow/types'
import { RiAlertFill, RiQuestionLine } from '@remixicon/react'
import React, { useCallback } from 'react'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import AddButton2 from '@/app/components/base/button/add-button'
import Switch from '@/app/components/base/switch'