lint: fix issue of no-unused-vars (#23375)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import React from 'react'
|
||||
import DatasetUpdateForm from '@/app/components/datasets/create'
|
||||
|
||||
type Props = {}
|
||||
|
||||
const DatasetCreation = async (props: Props) => {
|
||||
const DatasetCreation = async () => {
|
||||
return (
|
||||
<DatasetUpdateForm />
|
||||
)
|
||||
|
@@ -88,7 +88,8 @@ const HeaderOptions: FC<Props> = ({
|
||||
await clearAllAnnotations(appId)
|
||||
onAdded()
|
||||
}
|
||||
catch (_) {
|
||||
catch (e) {
|
||||
console.error(`failed to clear all annotations, ${e}`)
|
||||
}
|
||||
finally {
|
||||
setShowClearConfirm(false)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { AnswerNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: AnswerNodeType) => {
|
||||
export const checkNodeValid = (_payload: AnswerNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import type { AssignerNodeType } from './types'
|
||||
import { AssignerNodeInputType, WriteMode } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: AssignerNodeType) => {
|
||||
export const checkNodeValid = (_payload: AssignerNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { EndNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: EndNodeType) => {
|
||||
export const checkNodeValid = (_payload: EndNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
@@ -202,7 +202,7 @@ const ConditionItem = ({
|
||||
onRemoveCondition?.(caseId, condition.id)
|
||||
}, [caseId, condition, conditionId, isSubVariableKey, onRemoveCondition, onRemoveSubVariableCondition])
|
||||
|
||||
const handleVarChange = useCallback((valueSelector: ValueSelector, varItem: Var) => {
|
||||
const handleVarChange = useCallback((valueSelector: ValueSelector, _varItem: Var) => {
|
||||
const resolvedVarType = getVarType({
|
||||
valueSelector,
|
||||
availableNodes,
|
||||
|
@@ -82,7 +82,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
Toast.notify({ type: 'warning', message: `${t('common.modelProvider.parametersInvalidRemoved')}: ${keys.map(k => `${k} (${removedDetails[k]})`).join(', ')}` })
|
||||
handleCompletionParamsChange(filtered)
|
||||
}
|
||||
catch (e) {
|
||||
catch {
|
||||
Toast.notify({ type: 'error', message: t('common.error') })
|
||||
handleCompletionParamsChange({})
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ import { Validator } from 'jsonschema'
|
||||
import produce from 'immer'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const checkNodeValid = (payload: LLMNodeType) => {
|
||||
export const checkNodeValid = (_payload: LLMNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ const validator = new Validator()
|
||||
|
||||
export const validateSchemaAgainstDraft7 = (schemaToValidate: any) => {
|
||||
const schema = produce(schemaToValidate, (draft: any) => {
|
||||
// Make sure the schema has the $schema property for draft-07
|
||||
// Make sure the schema has the $schema property for draft-07
|
||||
if (!draft.$schema)
|
||||
draft.$schema = 'http://json-schema.org/draft-07/schema#'
|
||||
})
|
||||
|
@@ -6,7 +6,6 @@ import produce from 'immer'
|
||||
import { v4 as uuid4 } from 'uuid'
|
||||
import {
|
||||
useIsChatMode,
|
||||
useIsNodeInLoop,
|
||||
useNodesReadOnly,
|
||||
useWorkflow,
|
||||
} from '../../hooks'
|
||||
@@ -20,10 +19,8 @@ import type { HandleAddCondition, HandleAddSubVariableCondition, HandleRemoveCon
|
||||
import useIsVarFileAttribute from './use-is-var-file-attribute'
|
||||
import { useStore } from '@/app/components/workflow/store'
|
||||
|
||||
const DELIMITER = '@@@@@'
|
||||
const useConfig = (id: string, payload: LoopNodeType) => {
|
||||
const { nodesReadOnly: readOnly } = useNodesReadOnly()
|
||||
const { isNodeInLoop } = useIsNodeInLoop(id)
|
||||
const isChatMode = useIsChatMode()
|
||||
const conversationVariables = useStore(s => s.conversationVariables)
|
||||
|
||||
@@ -39,10 +36,8 @@ const useConfig = (id: string, payload: LoopNodeType) => {
|
||||
}, [])
|
||||
|
||||
// output
|
||||
const { getLoopNodeChildren, getBeforeNodesInSameBranch } = useWorkflow()
|
||||
const beforeNodes = getBeforeNodesInSameBranch(id)
|
||||
const { getLoopNodeChildren } = useWorkflow()
|
||||
const loopChildrenNodes = [{ id, data: payload } as any, ...getLoopNodeChildren(id)]
|
||||
const canChooseVarNodes = [...beforeNodes, ...loopChildrenNodes]
|
||||
const childrenNodeVars = toNodeOutputVars(loopChildrenNodes, isChatMode, undefined, [], conversationVariables)
|
||||
|
||||
const {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { StartNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: StartNodeType) => {
|
||||
export const checkNodeValid = (_payload: StartNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { TemplateTransformNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: TemplateTransformNodeType) => {
|
||||
export const checkNodeValid = (_payload: TemplateTransformNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { ToolNodeType } from './types'
|
||||
|
||||
export const checkNodeValid = (payload: ToolNodeType) => {
|
||||
export const checkNodeValid = (_payload: ToolNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ type InspectVarsActions = {
|
||||
|
||||
export type InspectVarsSliceShape = InspectVarsState & InspectVarsActions
|
||||
|
||||
export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set, get) => {
|
||||
export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set) => {
|
||||
return ({
|
||||
currentFocusNodeId: null,
|
||||
nodesWithInspectVars: [],
|
||||
@@ -75,11 +75,11 @@ export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set,
|
||||
if (!targetNode)
|
||||
return
|
||||
const targetVar = targetNode.vars.find(varItem => varItem.id === varId)
|
||||
if(!targetVar)
|
||||
if (!targetVar)
|
||||
return
|
||||
targetVar.value = value
|
||||
targetVar.edited = true
|
||||
},
|
||||
},
|
||||
)
|
||||
return {
|
||||
nodesWithInspectVars: nodes,
|
||||
@@ -93,11 +93,11 @@ export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set,
|
||||
if (!targetNode)
|
||||
return
|
||||
const targetVar = targetNode.vars.find(varItem => varItem.id === varId)
|
||||
if(!targetVar)
|
||||
if (!targetVar)
|
||||
return
|
||||
targetVar.value = value
|
||||
targetVar.edited = false
|
||||
},
|
||||
},
|
||||
)
|
||||
return {
|
||||
nodesWithInspectVars: nodes,
|
||||
@@ -111,11 +111,11 @@ export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set,
|
||||
if (!targetNode)
|
||||
return
|
||||
const targetVar = targetNode.vars.find(varItem => varItem.id === varId)
|
||||
if(!targetVar)
|
||||
if (!targetVar)
|
||||
return
|
||||
targetVar.name = selector[1]
|
||||
targetVar.selector = selector
|
||||
},
|
||||
},
|
||||
)
|
||||
return {
|
||||
nodesWithInspectVars: nodes,
|
||||
@@ -131,7 +131,7 @@ export const createInspectVarsSlice: StateCreator<InspectVarsSliceShape> = (set,
|
||||
const needChangeVarIndex = targetNode.vars.findIndex(varItem => varItem.id === varId)
|
||||
if (needChangeVarIndex !== -1)
|
||||
targetNode.vars.splice(needChangeVarIndex, 1)
|
||||
},
|
||||
},
|
||||
)
|
||||
return {
|
||||
nodesWithInspectVars: nodes,
|
||||
|
@@ -82,6 +82,7 @@ export default combine(
|
||||
'**/.next/',
|
||||
'**/public/*',
|
||||
'**/*.json',
|
||||
'**/*.js',
|
||||
],
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user