Skip to content

Commit 544fd05

Browse files
committed
chore(examples): lint
Signed-off-by: braks <[email protected]>
1 parent 4454867 commit 544fd05

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ onPaneReady((instance) => instance.fitView())
3131
3232
function changeType() {
3333
elements.value.forEach((el) => {
34-
if (isEdge(el) || el.type === 'input') return
34+
if (isEdge(el) || el.type === 'input') {
35+
return
36+
}
3537
el.type = el.type === 'default' ? 'output' : 'default'
3638
})
3739
}

examples/vite/src/Overview/Overview.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,26 @@ const initialElements: Elements = [
120120
const snapGrid: SnapGrid = [16, 16]
121121
122122
function nodeStrokeColor(n: Node): string {
123-
if ((n.style as Styles)?.background) return (n.style as Styles).background as string
124-
if (n.type === 'input') return '#0041d0'
125-
if (n.type === 'output') return '#ff0072'
126-
if (n.type === 'default') return '#1a192b'
123+
if ((n.style as Styles)?.background) {
124+
return (n.style as Styles).background as string
125+
}
126+
if (n.type === 'input') {
127+
return '#0041d0'
128+
}
129+
if (n.type === 'output') {
130+
return '#ff0072'
131+
}
132+
if (n.type === 'default') {
133+
return '#1a192b'
134+
}
127135
128136
return '#eee'
129137
}
130138
131139
function nodeColor(n: Node): string {
132-
if ((n.style as Styles)?.background) return (n.style as Styles).background as string
140+
if ((n.style as Styles)?.background) {
141+
return (n.style as Styles).background as string
142+
}
133143
134144
return '#fff'
135145
}

examples/vite/src/SnapHandle/SnappableConnectionLine.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
5959
},
6060
)
6161
62-
if (!closestNode.node) return
62+
if (!closestNode.node) {
63+
return
64+
}
6365
6466
canSnap.value = closestNode.distance < SNAP_DISTANCE
6567

0 commit comments

Comments
 (0)