lint: fix issue of no-unused-vars (#23375)

This commit is contained in:
Matri Qi
2025-08-05 11:12:30 +08:00
committed by GitHub
parent b946378b38
commit 75f722a959
14 changed files with 23 additions and 28 deletions

View File

@@ -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,