diff --git a/packages/ui/src/lib/BorderlessTextarea.svelte b/packages/ui/src/lib/BorderlessTextarea.svelte index 3c6c08fa0..3a112ce63 100644 --- a/packages/ui/src/lib/BorderlessTextarea.svelte +++ b/packages/ui/src/lib/BorderlessTextarea.svelte @@ -56,6 +56,7 @@ if (ref) { // reference the value to trigger // the effect when it changes + // eslint-disable-next-line @typescript-eslint/no-unused-expressions value; autoHeight(ref); } diff --git a/packages/ui/src/lib/commitLines/types.ts b/packages/ui/src/lib/commitLines/types.ts index 634522a84..e6df812b1 100644 --- a/packages/ui/src/lib/commitLines/types.ts +++ b/packages/ui/src/lib/commitLines/types.ts @@ -12,7 +12,7 @@ export interface CommitNodeData { commit?: CommitData; } -export interface BaseNodeData {} +export type BaseNodeData = object; export interface LineData { top: CellData; diff --git a/packages/ui/src/lib/segmentControl/Segment.svelte b/packages/ui/src/lib/segmentControl/Segment.svelte index d0dbc0a3f..0c827fc43 100644 --- a/packages/ui/src/lib/segmentControl/Segment.svelte +++ b/packages/ui/src/lib/segmentControl/Segment.svelte @@ -21,7 +21,9 @@ let isSelected = $state(false); $effect(() => { - elRef && isFocused && elRef.focus(); + if (elRef && isFocused) { + elRef.focus(); + } }); $effect(() => { @@ -47,7 +49,9 @@ index, id }); - onselect && onselect(id); + if (onselect) { + onselect(id); + } } }} onkeydown={({ key }) => { @@ -57,7 +61,9 @@ index, id }); - onselect && onselect(id); + if (onselect) { + onselect(id); + } } } }} diff --git a/packages/ui/src/lib/segmentControl/SegmentControl.svelte b/packages/ui/src/lib/segmentControl/SegmentControl.svelte index 568de6fe3..0804dccf9 100644 --- a/packages/ui/src/lib/segmentControl/SegmentControl.svelte +++ b/packages/ui/src/lib/segmentControl/SegmentControl.svelte @@ -30,7 +30,9 @@ setSelected: ({ index: segmentIndex, id }) => { if (segmentIndex >= 0 && segmentIndex < segments.length) { $selectedSegmentIndex = segmentIndex; - onselect && onselect(id); + if (onselect) { + onselect(id); + } } } }; diff --git a/packages/ui/src/lib/utils/convertToBase64.ts b/packages/ui/src/lib/utils/convertToBase64.ts index feb9793ca..05f477943 100644 --- a/packages/ui/src/lib/utils/convertToBase64.ts +++ b/packages/ui/src/lib/utils/convertToBase64.ts @@ -1,7 +1,7 @@ export function convertToBase64(iconString: string) { try { return btoa(iconString); - } catch (err) { + } catch { return Buffer.from(iconString).toString('base64'); } } diff --git a/packages/ui/src/lib/utils/portal.ts b/packages/ui/src/lib/utils/portal.ts index b32d53995..17a4c755b 100644 --- a/packages/ui/src/lib/utils/portal.ts +++ b/packages/ui/src/lib/utils/portal.ts @@ -1,6 +1,8 @@ export function portal(node: HTMLElement, to: string) { const target = document.querySelector(to); - target && target.appendChild(node); + if (target) { + target.appendChild(node); + } return { destroy() { if (node.isConnected) node.remove(); diff --git a/packages/ui/src/stories/button/DemoAllButtons.svelte b/packages/ui/src/stories/button/DemoAllButtons.svelte index d056e9d56..a960b46c7 100644 --- a/packages/ui/src/stories/button/DemoAllButtons.svelte +++ b/packages/ui/src/stories/button/DemoAllButtons.svelte @@ -1,6 +1,6 @@ - + {/snippet} diff --git a/packages/ui/src/stories/sidebarEntry/DemoSidebarEntry.svelte b/packages/ui/src/stories/sidebarEntry/DemoSidebarEntry.svelte index f559dd798..75c1eb515 100644 --- a/packages/ui/src/stories/sidebarEntry/DemoSidebarEntry.svelte +++ b/packages/ui/src/stories/sidebarEntry/DemoSidebarEntry.svelte @@ -1,6 +1,6 @@