Fix additional prefer-read-only-props violations in workflow and header components

Co-authored-by: asukaminato0721 <30024051+asukaminato0721@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-25 17:52:01 +00:00 committed by Asuka Minato
parent d3554b76e9
commit a259800fe4
13 changed files with 35 additions and 33 deletions

View File

@ -26,7 +26,7 @@ enum DocName {
}
type UpgradeOrDownloadProps = {
doc_name: DocName
readonly doc_name: DocName
}
const UpgradeOrDownload: FC<UpgradeOrDownloadProps> = ({ doc_name }) => {
const { t } = useTranslation()

View File

@ -7,7 +7,7 @@ import classNames from '@/utils/classnames'
import type { AppDetailResponse } from '@/models/app'
type IAppBackProps = {
curApp: AppDetailResponse
readonly curApp: AppDetailResponse
}
export default function AppBack({ curApp }: IAppBackProps) {
const { t } = useTranslation()

View File

@ -12,8 +12,8 @@ import { useAppContext } from '@/context/app-context'
import { noop } from 'lodash-es'
type IAppSelectorProps = {
appItems: AppDetailResponse[]
curApp: AppDetailResponse
readonly appItems: AppDetailResponse[]
readonly curApp: AppDetailResponse
}
export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {

View File

@ -6,7 +6,7 @@ import { useEventEmitterContextContext } from '@/context/event-emitter'
import classNames from '@/utils/classnames'
type HeaderWrapperProps = {
children: React.ReactNode
readonly children: React.ReactNode
}
const HeaderWrapper = ({

View File

@ -3,8 +3,8 @@
import classNames from '@/utils/classnames'
export type IndicatorProps = {
color?: 'green' | 'orange' | 'red' | 'blue' | 'yellow' | 'gray'
className?: string
readonly color?: 'green' | 'orange' | 'red' | 'blue' | 'yellow' | 'gray'
readonly className?: string
}
export type ColorMap = {

View File

@ -9,10 +9,10 @@ import PremiumBadge from '../../base/premium-badge'
import { Plan } from '../../billing/type'
type PlanBadgeProps = {
plan: Plan
allowHover?: boolean
sandboxAsUpgrade?: boolean
onClick?: () => void
readonly plan: Plan
readonly allowHover?: boolean
readonly sandboxAsUpgrade?: boolean
readonly onClick?: () => void
}
const PlanBadge: FC<PlanBadgeProps> = ({ plan, allowHover, sandboxAsUpgrade = false, onClick }) => {

View File

@ -11,6 +11,7 @@ import { FormTypeEnum } from '@/app/components/header/account-setting/model-prov
import { useRenderI18nObject } from '@/hooks/use-i18n'
import { ModelBar } from './components/model-bar'
// eslint-disable-next-line @eslint-react/prefer-read-only-props
const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
const { inputs, currentStrategy, currentStrategyStatus, pluginDetail } = useConfig(props.id, props.data)
const renderI18nObject = useRenderI18nObject()

View File

@ -25,6 +25,7 @@ export function strategyParamToCredientialForm(param: StrategyParamItem): Creden
}
}
// eslint-disable-next-line @eslint-react/prefer-read-only-props
const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
const {
inputs,

View File

@ -2,10 +2,10 @@ import React, { type FC } from 'react'
import { useTranslation } from 'react-i18next'
type CardProps = {
name: string
type: string
required: boolean
description?: string
readonly name: string
readonly type: string
readonly required: boolean
readonly description?: string
}
const Card: FC<CardProps> = ({

View File

@ -13,13 +13,13 @@ import AddField from './add-field'
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
type SchemaNodeProps = {
name: string
required: boolean
schema: Field
path: string[]
parentPath?: string[]
depth: number
readOnly?: boolean
readonly name: string
readonly required: boolean
readonly schema: Field
readonly path: string[]
readonly parentPath?: string[]
readonly depth: number
readonly readOnly?: boolean
}
// Support 10 levels of indentation

View File

@ -12,12 +12,12 @@ import type { ModelConfig } from '@/app/components/workflow/types'
import { useHooksStore } from '../../../hooks-store'
type Props = {
className?: string
onGenerated?: (prompt: string) => void
modelConfig?: ModelConfig
nodeId: string
editorId?: string
currentPrompt?: string
readonly className?: string
readonly onGenerated?: (prompt: string) => void
readonly modelConfig?: ModelConfig
readonly nodeId: string
readonly editorId?: string
readonly currentPrompt?: string
}
const PromptGeneratorBtn: FC<Props> = ({

View File

@ -5,9 +5,9 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import Switch from '@/app/components/base/switch'
type ReasoningFormatConfigProps = {
value?: 'tagged' | 'separated'
onChange: (value: 'tagged' | 'separated') => void
readonly?: boolean
readonly value?: 'tagged' | 'separated'
readonly onChange: (value: 'tagged' | 'separated') => void
readonly readonly?: boolean
}
const ReasoningFormatConfig: FC<ReasoningFormatConfigProps> = ({

View File

@ -8,8 +8,8 @@ import { Resolution } from '@/types/app'
const i18nPrefix = 'workflow.nodes.llm'
type Props = {
value: Resolution
onChange: (value: Resolution) => void
readonly value: Resolution
readonly onChange: (value: Resolution) => void
}
const ResolutionPicker: FC<Props> = ({