Fix frontend lint errors

This commit is contained in:
Mattias Granlund 2023-07-31 14:05:39 +02:00
parent de9c969e40
commit 0754c44128
16 changed files with 22 additions and 36 deletions

View File

@ -1,5 +1,6 @@
.DS_Store
node_modules
butler/target
/build
/.svelte-kit
/package
@ -23,4 +24,4 @@ yarn.lock
/histoire.setup.ts
/histoire.config.ts
/postcss.config.cjs
/tailwind.config.cjs
/tailwind.config.cjs

View File

@ -1,5 +1,6 @@
.DS_Store
node_modules
butler/target
/build
/.svelte-kit
/package

View File

@ -6,7 +6,6 @@ import {
IconFeedback,
IconTerminal,
IconSettings,
IconAdjustmentsHorizontal,
IconDiscord,
IconSearch,
IconRewind,

View File

@ -120,7 +120,7 @@
$: renderedRows = diffRows.rows.map((row) => ({ ...row, render: renderRowContent(row) }));
type RenderedRow = (typeof renderedRows)[0];
type RenderedRow = typeof renderedRows[0];
const padHighlighted = (rows: RenderedRow[]): RenderedRow[] => {
const chunks: (RenderedRow[] | RenderedRow)[] = [];

View File

@ -1,5 +1,4 @@
<script lang="ts">
import { scale } from 'svelte/transition';
import OutClick from 'svelte-outclick';
let dialog: HTMLDialogElement;

View File

@ -5,7 +5,7 @@
let showMenu = false;
let item: any;
function onDismiss(e: MouseEvent | KeyboardEvent | FocusEvent) {
function onDismiss() {
showMenu = false;
}

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte';
import { onDestroy } from 'svelte';
export let viewport: Element;
export let contents: Element;
@ -7,8 +7,8 @@
export let alwaysVisible = false;
export let initiallyVisible = false;
export let margin: { top?: number; right?: number; bottom?: number; left?: number } = {};
export let opacity: string = '0.2';
export let width: string = '0.625rem';
export let opacity = '0.2';
export let width = '0.625rem';
let thumb: Element;
let track: Element;
@ -68,7 +68,7 @@
track.addEventListener('mouseenter', onTrackEnter);
track.addEventListener('mouseleave', onTrackLeave);
return () => {
track.removeEventListener('mousedown', onThumbClick);
track.removeEventListener('mousedown', onTrackClick);
track.removeEventListener('mouseenter', onTrackEnter);
track.removeEventListener('mouseleave', onTrackLeave);
};

View File

@ -4,10 +4,8 @@
import { open } from '@tauri-apps/api/dialog';
import { toasts, Toaster, events, hotkeys, stores } from '$lib';
import type { LayoutData } from './$types';
import { Button, Link, Tooltip } from '$lib/components';
import { Link, Tooltip } from '$lib/components';
import { IconEmail } from '$lib/icons';
import type { Project } from '$lib/api';
import { PUBLIC_API_BASE_URL } from '$env/static/public';
import { page } from '$app/stores';
import { derived } from '@square/svelte-store';
import { onMount, setContext } from 'svelte';
@ -16,7 +14,6 @@
import LinkProjectModal from './LinkProjectModal.svelte';
import Breadcrumbs from './Breadcrumbs.svelte';
import ShareIssueModal from './ShareIssueModal.svelte';
import ThemeSelector from './ThemeSelector.svelte';
import { SETTINGS_CONTEXT, loadUserSettings } from '$lib/userSettings';
import { initTheme } from '$lib/theme';
@ -40,9 +37,6 @@
$: document.documentElement.style.fontSize = zoom + 'rem';
$: userSettings.update((s) => ({ ...s, zoom: zoom }));
const projectUrl = (project: Project) =>
new URL(`/projects/${project.id}`, new URL(PUBLIC_API_BASE_URL)).toString();
onMount(() =>
unsubscribe(
events.on('openNewProjectModal', () =>

View File

@ -1,6 +1,6 @@
<script lang="ts">
import type { LayoutData } from './$types';
import { Button, Tooltip } from '$lib/components';
import { Button } from '$lib/components';
import { events } from '$lib';
export let data: LayoutData;

View File

@ -1,7 +1,6 @@
<script lang="ts">
import type { Project } from '$lib/api';
import { IconHome } from '$lib/icons';
import { Button } from '$lib/components';
import { goto } from '$app/navigation';
export let project: Project | undefined;

View File

@ -1,12 +1,9 @@
<script lang="ts">
import type { LayoutData } from './$types';
import type { Project } from '$lib/api';
import { Button, Link, Tooltip } from '$lib/components';
import { Button, Tooltip } from '$lib/components';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { IconEmail, IconRewind, IconSearch, IconSettings, IconTerminal } from '$lib/icons';
import { PUBLIC_API_BASE_URL } from '$env/static/public';
import { events } from '$lib';
import { IconRewind, IconSearch, IconSettings, IconTerminal } from '$lib/icons';
export let data: LayoutData;
const { project } = data;
@ -16,9 +13,6 @@
const onSearchSubmit = () =>
goto(`/projects/${$project?.id}/search?q=${encodeURIComponent(query)}`);
const projectUrl = (project: Project) =>
new URL(`/projects/${project.id}`, new URL(PUBLIC_API_BASE_URL)).toString();
$: selection = $page?.route?.id?.split('/')?.[3];
</script>

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { slide } from 'svelte/transition';
import { IconTriangleUp, IconTriangleDown } from '$lib/icons';
import type { BaseBranch, Commit } from '$lib/vbranches';
import type { BaseBranch } from '$lib/vbranches';
import { formatDistanceToNow } from 'date-fns';
import type { SettingsStore } from '$lib/userSettings';

View File

@ -332,7 +332,9 @@
</div>
{/if}
</div>
<div class="w-3 shrink-0 border-l border-r border-light-400 bg-light-300 dark:bg-dark-500 dark:border-dark-600" />
<div
class="w-3 shrink-0 border-l border-r border-light-400 bg-light-300 dark:border-dark-600 dark:bg-dark-500"
/>
</div>
<div class="relative flex flex-grow overflow-y-hidden">

View File

@ -22,7 +22,6 @@
import { slide } from 'svelte/transition';
import { SETTINGS_CONTEXT, type SettingsStore } from '$lib/userSettings';
import { summarizeHunk } from '$lib/summaries';
import { Button } from '$lib/components';
export let file: File;
export let conflicted: boolean;

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Button, Checkbox, Modal } from '$lib/components';
import type { Branch, BranchData, Hunk } from '$lib/vbranches';
import type { Branch, BranchData } from '$lib/vbranches';
import { formatDistanceToNow } from 'date-fns';
import { IconGitBranch, IconRemote } from '$lib/icons';
import { IconTriangleDown, IconTriangleUp } from '$lib/icons';

View File

@ -14,14 +14,12 @@
let viewport: Element;
let contents: Element;
let fetching = false;
let buttonHovered = false;
const branchController = getContext<BranchController>(BRANCH_CONTROLLER_KEY);
// $: behind = baseBranch.behind > 0;
$: behindMessage = base.behind > 0 ? `behind ${base.behind}` : 'up-to-date';
let fetching = false;
$: expanded = base.behind > 0;
let buttonHovered = false;
</script>
<div
@ -71,7 +69,7 @@
</div>
{#if expanded}
<div
class="h-full w-3 shrink-0 border-l border-r border-light-400 bg-light-300 dark:bg-dark-500 dark:border-dark-600"
class="h-full w-3 shrink-0 border-l border-r border-light-400 bg-light-300 dark:border-dark-600 dark:bg-dark-500"
/>
{/if}
</div>