From 2f345d19769e6ce35c2737d160f2d27117289c9e Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:56:19 +1100 Subject: [PATCH] chore(ui): lint --- .../canvas/components/IAICanvasGrid.tsx | 10 +++++----- .../subpanels/AddModelsPanel/AddModels.tsx | 4 ++-- .../subpanels/ImportModelsPanel.tsx | 8 ++++---- .../flow/AddNodePopover/AddNodePopover.tsx | 6 +++--- .../store/util/findConnectionToValidHandle.ts | 18 +++++++++--------- .../features/nodes/util/graph/addHrfToGraph.ts | 2 +- .../util/graph/addSeamlessToLinearGraph.ts | 2 +- .../features/nodes/util/graph/addVAEToGraph.ts | 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx index 06925d90a3..b9105ce9dd 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx @@ -76,11 +76,11 @@ const IAICanvasGrid = () => { }; const // find the x & y size of the grid - xSize = gridFullRect.x2 - gridFullRect.x1, - ySize = gridFullRect.y2 - gridFullRect.y1, - // compute the number of steps required on each axis. - xSteps = Math.round(xSize / gridSpacing) + 1, - ySteps = Math.round(ySize / gridSpacing) + 1; + xSize = gridFullRect.x2 - gridFullRect.x1; + const ySize = gridFullRect.y2 - gridFullRect.y1; + // compute the number of steps required on each axis. + const xSteps = Math.round(xSize / gridSpacing) + 1; + const ySteps = Math.round(ySize / gridSpacing) + 1; const strokeWidth = unscale(1); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx index 9796a0e6a3..cb50334c99 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx @@ -13,10 +13,10 @@ const AddModels = () => { return ( - - diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx index 93cdd25a7e..18fcef9614 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx @@ -17,16 +17,16 @@ const ImportModelsPanel = () => { return ( - - - {addModelTab == 'add' && } - {addModelTab == 'scan' && } + {addModelTab === 'add' && } + {addModelTab === 'scan' && } ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx index 5d2bb1f3d2..faa4c0b054 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx @@ -58,11 +58,11 @@ const AddNodePopover = () => { // If we have a connection in progress, we need to filter the node choices const filteredNodeTemplates = fieldFilter ? filter(nodeTemplates.templates, (template) => { - const handles = handleFilter == 'source' ? template.inputs : template.outputs; + const handles = handleFilter === 'source' ? template.inputs : template.outputs; return some(handles, (handle) => { - const sourceType = handleFilter == 'source' ? fieldFilter : handle.type; - const targetType = handleFilter == 'target' ? fieldFilter : handle.type; + const sourceType = handleFilter === 'source' ? fieldFilter : handle.type; + const targetType = handleFilter === 'target' ? fieldFilter : handle.type; return validateSourceAndTargetTypes(sourceType, targetType); }); diff --git a/invokeai/frontend/web/src/features/nodes/store/util/findConnectionToValidHandle.ts b/invokeai/frontend/web/src/features/nodes/store/util/findConnectionToValidHandle.ts index 49970a8f9e..9f2c37a2ad 100644 --- a/invokeai/frontend/web/src/features/nodes/store/util/findConnectionToValidHandle.ts +++ b/invokeai/frontend/web/src/features/nodes/store/util/findConnectionToValidHandle.ts @@ -50,16 +50,16 @@ export const findConnectionToValidHandle = ( return null; } - const handles = handleCurrentType == 'source' ? node.data.inputs : node.data.outputs; + const handles = handleCurrentType === 'source' ? node.data.inputs : node.data.outputs; //Prioritize handles whos name matches the node we're coming from if (handles[handleCurrentName]) { const handle = handles[handleCurrentName]; - const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id; - const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId; - const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name; - const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName; + const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id; + const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId; + const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name; + const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName; const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges); @@ -78,10 +78,10 @@ export const findConnectionToValidHandle = ( for (const handleName in handles) { const handle = handles[handleName]; - const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id; - const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId; - const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name; - const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName; + const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id; + const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId; + const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name; + const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName; const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges); diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/addHrfToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/addHrfToGraph.ts index 9e9fcefcb0..daa214364d 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/addHrfToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/addHrfToGraph.ts @@ -175,7 +175,7 @@ export const addHrfToGraph = (state: RootState, graph: NonNullableGraph): void = width: width, height: height, }; - if (hrfMethod == 'ESRGAN') { + if (hrfMethod === 'ESRGAN') { let model_name: ESRGANInvocation['model_name'] = 'RealESRGAN_x2plus.pth'; if ((width * height) / (hrfWidth * hrfHeight) > 2) { model_name = 'RealESRGAN_x4plus.pth'; diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/addSeamlessToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/addSeamlessToLinearGraph.ts index 89e8900644..850b2a65bd 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/addSeamlessToLinearGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/addSeamlessToLinearGraph.ts @@ -96,7 +96,7 @@ export const addSeamlessToLinearGraph = ( ); if ( - graph.id == CANVAS_INPAINT_GRAPH || + graph.id === CANVAS_INPAINT_GRAPH || graph.id === CANVAS_OUTPAINT_GRAPH || graph.id === SDXL_CANVAS_INPAINT_GRAPH || graph.id === SDXL_CANVAS_OUTPAINT_GRAPH diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/addVAEToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/addVAEToGraph.ts index c0b44d9100..b886c9b7d5 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/addVAEToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/addVAEToGraph.ts @@ -70,7 +70,7 @@ export const addVAEToGraph = ( graph.id === CANVAS_TEXT_TO_IMAGE_GRAPH || graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH || graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH || - graph.id == SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH + graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH ) { graph.edges.push({ source: {