chore(docs): lint
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -69,7 +69,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
|
||||
},
|
||||
)
|
||||
|
||||
if (!closestNode.node) return
|
||||
if (!closestNode.node) {
|
||||
return
|
||||
}
|
||||
|
||||
canSnap.value = closestNode.distance < SNAP_DISTANCE
|
||||
|
||||
@@ -92,8 +94,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
|
||||
},
|
||||
edges.value,
|
||||
)
|
||||
)
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (closestHandle) {
|
||||
const el = document.querySelector(`[data-handleid='${closestHandle.id}']`)
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
|
||||
@@ -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 }
|
||||
},
|
||||
})
|
||||
|
||||
@@ -118,7 +118,9 @@ onNodeDoubleClick(({ node }) => {
|
||||
stopHandle = watchDebounced(
|
||||
output,
|
||||
(next) => {
|
||||
if (!showDot.value) return
|
||||
if (!showDot.value) {
|
||||
return
|
||||
}
|
||||
|
||||
const nextLength = curve.value.getTotalLength()
|
||||
|
||||
|
||||
@@ -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(' ')
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user