Skip to content

Commit 32d7d5b

Browse files
committed
[web-console] Format using new 'force brackets in conditions' rule
Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
1 parent 69eb5a3 commit 32d7d5b

21 files changed

Lines changed: 102 additions & 45 deletions

js-packages/web-console/src/lib/components/pipelines/editor/performance/CheckpointActivityStatus.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
)
2929
3030
const formatPermanentError = (e: (typeof permanentErrors & {})[number]) => {
31-
if (typeof e === 'string')
31+
if (typeof e === 'string') {
3232
return e === 'StorageRequired'
3333
? 'Storage must be configured'
3434
: e === 'EnterpriseFeature'
3535
? 'Enterprise feature'
3636
: e
37+
}
3738
if ('UnsupportedInputEndpoint' in e) {
3839
return `Input "${e.UnsupportedInputEndpoint}" does not support checkpointing`
3940
}
@@ -55,8 +56,9 @@
5556
return r
5657
}
5758
}
58-
if (r && typeof r === 'object' && 'InputEndpointBarrier' in r)
59+
if (r && typeof r === 'object' && 'InputEndpointBarrier' in r) {
5960
return `Input "${(r as { InputEndpointBarrier: string }).InputEndpointBarrier}" barrier`
61+
}
6062
return String(r)
6163
}
6264
</script>

js-packages/web-console/src/lib/components/pipelines/editor/performance/CheckpointsStatus.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
<CheckpointDialog onConfirm={handleCheckpoint} />
4343
{/snippet}
4444

45-
<div class="bg-white-dark flex h-full flex-col gap-2 rounded pt-4 px-4">
45+
<div class="bg-white-dark flex h-full flex-col gap-2 rounded px-4 pt-4">
4646
<div class="flex items-start justify-between">
4747
<div class="text-lg font-medium">Checkpoints</div>
4848
<button class="fd fd-x text-[20px]" onclick={onClose} aria-label="Close"></button>
4949
</div>
50-
<div class="scrollbar flex-1 overflow-y-auto pr-4 -mr-4">
50+
<div class="-mr-4 scrollbar flex-1 overflow-y-auto pr-4">
5151
{#if checkpoints.length === 0}
5252
<div class="p-2 text-surface-500">No checkpoints</div>
5353
{:else}

js-packages/web-console/src/lib/components/pipelines/editor/performance/ConnectorErrors.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
})
131131
</script>
132132

133-
<div class="bg-white-dark flex h-full flex-col gap-2 rounded pt-4 px-4">
133+
<div class="bg-white-dark flex h-full flex-col gap-2 rounded px-4 pt-4">
134134
<div class="flex items-start justify-between">
135135
<div>
136136
<div class="font-medium">{relationName} · {strippedConnectorName}</div>
@@ -159,7 +159,7 @@
159159
</SegmentedControl>
160160
<span class="text-surface-500">errors</span>
161161
</div>
162-
<div class="scrollbar flex-1 overflow-y-auto pr-4 -mr-4">
162+
<div class="-mr-4 scrollbar flex-1 overflow-y-auto pr-4">
163163
{#if loading}
164164
<div class="p-2 text-surface-500">Loading…</div>
165165
{:else if displayItems.length === 0}

js-packages/web-console/src/lib/components/pipelines/editor/performance/MetricsTables.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@
211211
{#if hasErrors}
212212
<span
213213
data-testid="btn-icon-output-errors"
214-
class="fd {hasFatalError ? 'fd-circle-x' : 'fd-circle-alert'} cursor-pointer text-[16px] text-error-500"
214+
class="fd {hasFatalError
215+
? 'fd-circle-x'
216+
: 'fd-circle-alert'} cursor-pointer text-[16px] text-error-500"
215217
{...onErrorClick
216218
? {
217219
onclick: (e) => {
@@ -502,7 +504,9 @@
502504
{/snippet}
503505

504506
{#snippet tableMultiConnectorCell(data: AggregatedInputEndpointMetrics, isExpanded: boolean)}
505-
{@const runningCount = data.connectors.filter((c) => c.paused === false && c.metrics.end_of_input === false).length}
507+
{@const runningCount = data.connectors.filter(
508+
(c) => c.paused === false && c.metrics.end_of_input === false
509+
).length}
506510
{@const anyErrors = data.connectors.some(inputHasErrors)}
507511
{@const anyFatalError = data.connectors.some((c) => c.fatal_error != null)}
508512
{@const anyBarrier = data.connectors.some((c) => c.barrier === true)}

js-packages/web-console/src/lib/components/pipelines/table/AvailableActions.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
.map((p) => p.name)
7676
.sort()
7777
const actions = $derived.by(() => {
78-
if (selected.length === 0) return []
78+
if (selected.length === 0) {
79+
return []
80+
}
7981
const supportedByAny = new Set(selected.flatMap(statusActions))
8082
return availableActions
8183
.filter((action) => supportedByAny.has(action))

js-packages/web-console/src/lib/compositions/common/userSelect.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ export const virtualSelect = (
319319
expectCaretFromClick = false
320320
if (selection.anchorNode && root.contains(selection.anchorNode)) {
321321
const pos = domPointToLogical(selection.anchorNode, selection.anchorOffset)
322-
if (pos) caretPosition = pos
322+
if (pos) {
323+
caretPosition = pos
324+
}
323325
}
324326
}
325327
// Selection collapsed — decide whether to preserve the tracked selection.
@@ -512,7 +514,9 @@ export const virtualSelect = (
512514
}
513515

514516
function oncopy(e: ClipboardEvent) {
515-
if (currentSelection === null) return
517+
if (currentSelection === null) {
518+
return
519+
}
516520
let content: string
517521
if (currentSelection === 'all') {
518522
content = getCopyContent('all')
@@ -597,14 +601,18 @@ export const virtualSelect = (
597601
// Starting a new drag-selection is unaffected: handleSelectionChange will set
598602
// currentSelection when the Range appears.
599603
function handlePointerDown(e: PointerEvent) {
600-
if (e.button !== 0) return
604+
if (e.button !== 0) {
605+
return
606+
}
601607
// Ignore clicks on the scrollbar. We use elementFromPoint to detect this:
602608
// if the hit element is the scroll container itself (not a descendant), the
603609
// click landed on the scrollbar or empty padding. This works for both Chrome's
604610
// classic scrollbar (which occupies space outside clientWidth) and Firefox's
605611
// overlay scrollbar (which hovers over content and doesn't reduce clientWidth).
606612
const hitEl = document.elementFromPoint(e.clientX, e.clientY)
607-
if (hitEl === node) return
613+
if (hitEl === node) {
614+
return
615+
}
608616

609617
// Shift+click with an off-screen caretPosition: the browser can't create the
610618
// right Range (the original caret node was recycled), so we'll handle it in

js-packages/web-console/src/lib/compositions/layout/useGlobalDialog.svelte.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export const useGlobalDialog = () => {
3434
},
3535
set dialog(value: typeof globalDialog) {
3636
globalDialog = value
37-
if (!value) globalOnClickAway = null
37+
if (!value) {
38+
globalOnClickAway = null
39+
}
3840
},
3941
get onClickAway() {
4042
return globalOnClickAway

js-packages/web-console/src/lib/compositions/pipelines/useChangedPipelines.svelte.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ let state = $state([] as string[])
1515
export const useChangedPipelines = () => {
1616
return {
1717
add(pipelineName: string) {
18-
if (!state.includes(pipelineName)) state.push(pipelineName)
18+
if (!state.includes(pipelineName)) {
19+
state.push(pipelineName)
20+
}
1921
},
2022
remove(pipelineName: string) {
2123
const idx = state.findIndex((x) => x === pipelineName)
22-
if (idx !== -1) state.splice(idx, 1)
24+
if (idx !== -1) {
25+
state.splice(idx, 1)
26+
}
2327
},
2428
rename(oldPipelineName: string, newPipelineName: string) {
2529
const idx = state.findIndex((x) => x === oldPipelineName)
26-
if (idx !== -1) state.splice(idx, 1, newPipelineName)
30+
if (idx !== -1) {
31+
state.splice(idx, 1, newPipelineName)
32+
}
2733
},
2834
get list() {
2935
return state

js-packages/web-console/src/lib/compositions/useAggregatePipelineStats.svelte.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export const useAggregatePipelineStats = (
6262
return
6363
}
6464
metricsAvailable
65-
if (options?.getDeleted?.()) return
65+
if (options?.getDeleted?.()) {
66+
return
67+
}
6668
const cancel = untrack(() => closedIntervalAction(() => doFetch(pipelineName), refetchMs))
6769
return () => {
6870
cancel()

js-packages/web-console/src/lib/compositions/useReactiveWaiter.svelte.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export function useReactiveWaiter<T>(
6363
const currentValue = reactiveState()
6464
const waitingWaiters = Array.from(activeWaiters.values()).filter((waiter) => waiter.isWaiting)
6565

66-
if (waitingWaiters.length === 0) return
66+
if (waitingWaiters.length === 0) {
67+
return
68+
}
6769

6870
for (const waiter of waitingWaiters) {
6971
try {

0 commit comments

Comments
 (0)