Skip to content

Commit

Permalink
chore(docs): lint
Browse files Browse the repository at this point in the history
Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Apr 11, 2023
1 parent f4616af commit 4454867
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/components/Repl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineComponent({
props: ['example'],
setup(props) {
return () => {
if (!isClient) return null
if (!isClient) {
return null
}
return h(Suspense, h(DocsRepl, props))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
},
)
if (!closestNode.node) return
if (!closestNode.node) {
return
}
canSnap.value = closestNode.distance < SNAP_DISTANCE
Expand All @@ -92,8 +94,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
},
edges.value,
)
)
) {
return
}
if (closestHandle) {
const el = document.querySelector(`[data-handleid='${closestHandle.id}']`)
Expand Down
16 changes: 12 additions & 4 deletions docs/components/examples/custom-node/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ const connectionLineStyle = { stroke: '#fff' }
// minimap stroke color functions
function nodeStroke(n) {
if (n.type === 'input') return '#0041d0'
if (n.type === 'custom') return presets.sumi
if (n.type === 'output') return '#ff0072'
if (n.type === 'input') {
return '#0041d0'
}
if (n.type === 'custom') {
return presets.sumi
}
if (n.type === 'output') {
return '#ff0072'
}
return '#eee'
}
function nodeColor(n) {
if (n.type === 'custom') return bgColor.value
if (n.type === 'custom') {
return bgColor.value
}
return '#fff'
}
Expand Down
4 changes: 3 additions & 1 deletion docs/components/examples/stress/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export function getElements(xElements = 10, yElements = 10) {
source: recentNodeId.toString(),
target: nodeId.toString(),
style: (edge) => {
if (!edge.sourceNode.selected && !edge.targetNode.selected) return
if (!edge.sourceNode.selected && !edge.targetNode.selected) {
return
}
return { stroke: '#10b981', strokeWidth: 3 }
},
})
Expand Down
4 changes: 3 additions & 1 deletion docs/components/examples/transition/TransitionEdge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ onNodeDoubleClick(({ node }) => {
stopHandle = watchDebounced(
output,
(next) => {
if (!showDot.value) return
if (!showDot.value) {
return
}
const nextLength = curve.value.getTotalLength()
Expand Down
3 changes: 2 additions & 1 deletion docs/components/home/flows/Basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ const emit = defineEmits(['pane'])
const getNodeClass: ClassFunc<GraphNode> = (el) => {
const classes = ['font-semibold', '!border-2', 'transition-colors', 'duration-300', 'ease-in-out']
if (el.selected)
if (el.selected) {
classes.push(
...['!border-green-500/80', '!shadow-md', '!shadow-green-500/50', '!bg-green-100/80 dark:(!bg-white)', '!text-gray-700'],
)
}
return classes.join(' ')
}
Expand Down
11 changes: 8 additions & 3 deletions docs/components/home/flows/Intro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ const clicks = ref(0)
const disabled = ref(false)
const confettiColors = Object.values(colors).flatMap((color) => {
if (typeof color === 'string') return color
else return Object.values(color).flatMap((c) => c)
if (typeof color === 'string') {
return color
} else {
return Object.values(color).flatMap((c) => c)
}
})
onNodeClick(async ({ node }) => {
if (node.id === 'intro') {
if (disabled.value) return
if (disabled.value) {
return
}
animatedBackground.value = !animatedBackground.value
Expand Down
4 changes: 3 additions & 1 deletion docs/src/.vitepress/plugins/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const skip = ['node_modules', 'dist', 'turbo']

const getAllFiles = function (dirPath: string, needle?: string, arrayOfFiles: ChangelogFile[] = [], pkgName?: string) {
readdirSync(dirPath).forEach((file) => {
if (skip.includes(file)) return
if (skip.includes(file)) {
return
}

if (statSync(`${dirPath}/${file}`).isDirectory()) {
getAllFiles(`${dirPath}/${file}`, needle, arrayOfFiles, file)
Expand Down
3 changes: 2 additions & 1 deletion docs/src/.vitepress/plugins/vercel-web-vitals-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ function sendToAnalytics(metric, options) {
})
if (navigator.sendBeacon) {
navigator.sendBeacon(vitalsUrl, blob)
} else
} else {
fetch(vitalsUrl, {
body: blob,
method: 'POST',
credentials: 'omit',
keepalive: true,
})
}
}

export function webVitals(options) {
Expand Down

0 comments on commit 4454867

Please sign in to comment.