mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-22 19:14:31 +03:00
fix: packages/ui eslint issues
This commit is contained in:
parent
f928b25fff
commit
26713898b8
@ -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);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export interface CommitNodeData {
|
||||
commit?: CommitData;
|
||||
}
|
||||
|
||||
export interface BaseNodeData {}
|
||||
export type BaseNodeData = object;
|
||||
|
||||
export interface LineData {
|
||||
top: CellData;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
@ -30,7 +30,9 @@
|
||||
setSelected: ({ index: segmentIndex, id }) => {
|
||||
if (segmentIndex >= 0 && segmentIndex < segments.length) {
|
||||
$selectedSegmentIndex = segmentIndex;
|
||||
onselect && onselect(id);
|
||||
if (onselect) {
|
||||
onselect(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
export function convertToBase64(iconString: string) {
|
||||
try {
|
||||
return btoa(iconString);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return Buffer.from(iconString).toString('base64');
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { ComponentColor } from '$lib/utils/colorTypes';
|
||||
import Button from '$lib/Button.svelte';
|
||||
import type { ComponentColor } from '$lib/utils/colorTypes';
|
||||
|
||||
interface Props {
|
||||
label: string;
|
||||
|
@ -2,9 +2,9 @@
|
||||
import Button from '$lib/Button.svelte';
|
||||
import Modal from '$lib/Modal.svelte';
|
||||
|
||||
const { ...args }: typeof Modal = $props();
|
||||
const { ...args }: ReturnType<typeof Modal> = $props();
|
||||
|
||||
let modal: Modal;
|
||||
let modal: ReturnType<typeof Modal>;
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
{#snippet controls(close)}
|
||||
<Button style="ghost" outline onclick={() => close()}>Cancel</Button>
|
||||
<Button style="pop" kind="solid" type="submit" onclick={() => console.log('clicked')}
|
||||
>Merge</Button
|
||||
>
|
||||
<Button style="pop" kind="solid" type="submit" onclick={() => console.log('clicked')}>
|
||||
Merge
|
||||
</Button>
|
||||
{/snippet}
|
||||
</Modal>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import AvatarGroup from '$lib/avatar/AvatarGroup.svelte';
|
||||
import SidebarEntry from '$lib/SidebarEntry.svelte';
|
||||
import AvatarGroup from '$lib/avatar/AvatarGroup.svelte';
|
||||
|
||||
interface Props {
|
||||
selected?: boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user