Skip to content

Commit 4454867

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

File tree

9 files changed

+41
-15
lines changed

9 files changed

+41
-15
lines changed

docs/components/Repl.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export default defineComponent({
77
props: ['example'],
88
setup(props) {
99
return () => {
10-
if (!isClient) return null
10+
if (!isClient) {
11+
return null
12+
}
1113
1214
return h(Suspense, h(DocsRepl, props))
1315
}

docs/components/examples/connection-radius/SnappableConnectionLine.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
6969
},
7070
)
7171
72-
if (!closestNode.node) return
72+
if (!closestNode.node) {
73+
return
74+
}
7375
7476
canSnap.value = closestNode.distance < SNAP_DISTANCE
7577
@@ -92,8 +94,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
9294
},
9395
edges.value,
9496
)
95-
)
97+
) {
9698
return
99+
}
97100
98101
if (closestHandle) {
99102
const el = document.querySelector(`[data-handleid='${closestHandle.id}']`)

docs/components/examples/custom-node/App.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,22 @@ const connectionLineStyle = { stroke: '#fff' }
1919
2020
// minimap stroke color functions
2121
function nodeStroke(n) {
22-
if (n.type === 'input') return '#0041d0'
23-
if (n.type === 'custom') return presets.sumi
24-
if (n.type === 'output') return '#ff0072'
22+
if (n.type === 'input') {
23+
return '#0041d0'
24+
}
25+
if (n.type === 'custom') {
26+
return presets.sumi
27+
}
28+
if (n.type === 'output') {
29+
return '#ff0072'
30+
}
2531
return '#eee'
2632
}
2733
2834
function nodeColor(n) {
29-
if (n.type === 'custom') return bgColor.value
35+
if (n.type === 'custom') {
36+
return bgColor.value
37+
}
3038
return '#fff'
3139
}
3240

docs/components/examples/stress/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export function getElements(xElements = 10, yElements = 10) {
2222
source: recentNodeId.toString(),
2323
target: nodeId.toString(),
2424
style: (edge) => {
25-
if (!edge.sourceNode.selected && !edge.targetNode.selected) return
25+
if (!edge.sourceNode.selected && !edge.targetNode.selected) {
26+
return
27+
}
2628
return { stroke: '#10b981', strokeWidth: 3 }
2729
},
2830
})

docs/components/examples/transition/TransitionEdge.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ onNodeDoubleClick(({ node }) => {
118118
stopHandle = watchDebounced(
119119
output,
120120
(next) => {
121-
if (!showDot.value) return
121+
if (!showDot.value) {
122+
return
123+
}
122124
123125
const nextLength = curve.value.getTotalLength()
124126

docs/components/home/flows/Basic.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ const emit = defineEmits(['pane'])
1010
1111
const getNodeClass: ClassFunc<GraphNode> = (el) => {
1212
const classes = ['font-semibold', '!border-2', 'transition-colors', 'duration-300', 'ease-in-out']
13-
if (el.selected)
13+
if (el.selected) {
1414
classes.push(
1515
...['!border-green-500/80', '!shadow-md', '!shadow-green-500/50', '!bg-green-100/80 dark:(!bg-white)', '!text-gray-700'],
1616
)
17+
}
1718
1819
return classes.join(' ')
1920
}

docs/components/home/flows/Intro.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,18 @@ const clicks = ref(0)
7575
const disabled = ref(false)
7676
7777
const confettiColors = Object.values(colors).flatMap((color) => {
78-
if (typeof color === 'string') return color
79-
else return Object.values(color).flatMap((c) => c)
78+
if (typeof color === 'string') {
79+
return color
80+
} else {
81+
return Object.values(color).flatMap((c) => c)
82+
}
8083
})
8184
8285
onNodeClick(async ({ node }) => {
8386
if (node.id === 'intro') {
84-
if (disabled.value) return
87+
if (disabled.value) {
88+
return
89+
}
8590
8691
animatedBackground.value = !animatedBackground.value
8792

docs/src/.vitepress/plugins/changelog.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const skip = ['node_modules', 'dist', 'turbo']
1010

1111
const getAllFiles = function (dirPath: string, needle?: string, arrayOfFiles: ChangelogFile[] = [], pkgName?: string) {
1212
readdirSync(dirPath).forEach((file) => {
13-
if (skip.includes(file)) return
13+
if (skip.includes(file)) {
14+
return
15+
}
1416

1517
if (statSync(`${dirPath}/${file}`).isDirectory()) {
1618
getAllFiles(`${dirPath}/${file}`, needle, arrayOfFiles, file)

docs/src/.vitepress/plugins/vercel-web-vitals-api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ function sendToAnalytics(metric, options) {
3131
})
3232
if (navigator.sendBeacon) {
3333
navigator.sendBeacon(vitalsUrl, blob)
34-
} else
34+
} else {
3535
fetch(vitalsUrl, {
3636
body: blob,
3737
method: 'POST',
3838
credentials: 'omit',
3939
keepalive: true,
4040
})
41+
}
4142
}
4243

4344
export function webVitals(options) {

0 commit comments

Comments
 (0)