From 544fd05d3e088700e62a6a8de8787f62bf8d13f9 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 11 Apr 2023 20:30:23 +0200 Subject: [PATCH] chore(examples): lint Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .../NodeTypeChange/NodeTypeChangeExample.vue | 4 +++- examples/vite/src/Overview/Overview.vue | 20 ++++++++++++++----- .../SnapHandle/SnappableConnectionLine.vue | 4 +++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue b/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue index 157fbf47..6fcc75ae 100644 --- a/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue +++ b/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue @@ -31,7 +31,9 @@ onPaneReady((instance) => instance.fitView()) function changeType() { elements.value.forEach((el) => { - if (isEdge(el) || el.type === 'input') return + if (isEdge(el) || el.type === 'input') { + return + } el.type = el.type === 'default' ? 'output' : 'default' }) } diff --git a/examples/vite/src/Overview/Overview.vue b/examples/vite/src/Overview/Overview.vue index 41790213..46ad7127 100644 --- a/examples/vite/src/Overview/Overview.vue +++ b/examples/vite/src/Overview/Overview.vue @@ -120,16 +120,26 @@ const initialElements: Elements = [ const snapGrid: SnapGrid = [16, 16] function nodeStrokeColor(n: Node): string { - if ((n.style as Styles)?.background) return (n.style as Styles).background as string - if (n.type === 'input') return '#0041d0' - if (n.type === 'output') return '#ff0072' - if (n.type === 'default') return '#1a192b' + if ((n.style as Styles)?.background) { + return (n.style as Styles).background as string + } + if (n.type === 'input') { + return '#0041d0' + } + if (n.type === 'output') { + return '#ff0072' + } + if (n.type === 'default') { + return '#1a192b' + } return '#eee' } function nodeColor(n: Node): string { - if ((n.style as Styles)?.background) return (n.style as Styles).background as string + if ((n.style as Styles)?.background) { + return (n.style as Styles).background as string + } return '#fff' } diff --git a/examples/vite/src/SnapHandle/SnappableConnectionLine.vue b/examples/vite/src/SnapHandle/SnappableConnectionLine.vue index c6eecc96..0a712afa 100644 --- a/examples/vite/src/SnapHandle/SnappableConnectionLine.vue +++ b/examples/vite/src/SnapHandle/SnappableConnectionLine.vue @@ -59,7 +59,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => { }, ) - if (!closestNode.node) return + if (!closestNode.node) { + return + } canSnap.value = closestNode.distance < SNAP_DISTANCE