Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: eslint errors #341

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ declare global {
}
}

module;

export {};
4 changes: 3 additions & 1 deletion src/lib/components/Line.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
on:click={() => isDone.toggle()}
type="button"
title="Click to mark as done"
aria-label="Click to mark as done"
>
<span
class="text-bold icon-[solar--file-bold-duotone]"
Expand Down Expand Up @@ -86,6 +87,7 @@
{isFile && data.size != '0 B' ? data.size : '-'}
{#if data.size != '0 B'}
<a
aria-label="Download"
class="flex text-lg ml-3"
href={GH_PAGES_BASE_URL + base + '/' + data.name}
download
Expand All @@ -94,7 +96,7 @@
<span class="text-accent text-3xl icon-[solar--download-square-bold]"></span>
</a>
{:else}
<button disabled class="flex text-lg ml-3">
<button disabled class="flex text-lg ml-3" aria-label="Download">
<span class="text-neutral text-3xl icon-[solar--download-square-bold]"></span>
</button>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/[...dir]/[file=asciidoc]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
</svelte:head>

<main class="container m-auto grid gap-4 grid-cols-[4fr,1fr]">
<section class="prose m-auto" id="markdown" bind:this={docContainer} role="document" />
<section class="prose" id="toc" role="contentinfo" />
<section class="prose m-auto" id="markdown" bind:this={docContainer} role="document"></section>
<section class="prose" id="toc" role="contentinfo"></section>
</main>

<style>
Expand Down
11 changes: 6 additions & 5 deletions src/routes/[...dir]/[file=markdown]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import { EDIT_URLS } from '../../../lib/const';
import { page } from '$app/stores';
import { fade } from 'svelte/transition';

import 'katex/dist/katex.css';

export let data: PageData;

let markdown: HTMLElement;
Expand Down Expand Up @@ -48,9 +51,9 @@
class="btn btn-ghost text-2xl"
>
{#if menuOpen}
<span class="icon-[material-symbols--close-rounded]" />
<span class="icon-[material-symbols--close-rounded]"></span>
{:else}
<span class="icon-[material-symbols--menu-rounded]" />
<span class="icon-[material-symbols--menu-rounded]"></span>
{/if}
</button>
</div>
Expand Down Expand Up @@ -89,13 +92,11 @@
bind:this={tocContainer}
class:tocHidden={!menuOpen}
>
<section class="prose mt-10" id="toc" bind:this={toc} role="contentinfo" />
<section class="prose mt-10" id="toc" bind:this={toc} role="contentinfo"></section>
</div>
</main>

<style>
@import 'katex/dist/katex.css';

.tocHidden {
max-width: 0;
margin: 0;
Expand Down
16 changes: 1 addition & 15 deletions src/routes/[...dir]/[zfile=dir]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import Line from '$lib/components/Line.svelte';
import { teachingsFilter, type Degree } from '$lib/teachings';
import { EDIT_URLS } from '$lib/const';
import { doneFiles, anyFileDone } from '$lib/todo-file';

import type { PageData } from './$types';
Expand All @@ -13,25 +12,11 @@

let fuzzy: FuzzySearch;

let editUrls = EDIT_URLS($page.url.pathname);

// -- breadcrumbs --
let breadcrumbMobile = true;
function mobileBreadcrumb() {
breadcrumbMobile = !breadcrumbMobile;
}

$: urlParts = $page.url.pathname
.split('/')
.slice(1)
.filter((p) => p !== ''); // otherwise we get an empty string at the end

const getPartHref = (part: string) =>
$page.url.pathname
.split('/')
.slice(0, $page.url.pathname.split('/').indexOf(part) + 1)
.join('/');

function kebabToTitle(str: string) {
return str
.split('-')
Expand Down Expand Up @@ -129,6 +114,7 @@
class="lg:ml-2 p-1 flex mr-2 items-center"
on:click={cleanDone}
title="Clean all done files in this page"
aria-label="Clean all done files in this page"
>
<span class="text-warning text-xl icon-[solar--broom-bold-duotone]"></span>
</button>
Expand Down
1 change: 1 addition & 0 deletions src/routes/[...dir]/[zfile=dir]/FuzzySearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
let focusIdx = 0;
$: {
// every time the search query changes, reset the active element
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
query;
focusIdx = 0;
}
Expand Down
2 changes: 0 additions & 2 deletions src/routes/[...dir]/[zfile=generic]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import { onMount } from 'svelte';
import type { PageData } from './$types';
import Breadcrumbs from '$lib/components/Breadcrumbs.svelte';
import { page } from '$app/stores';

export let data: PageData;

Expand Down
2 changes: 1 addition & 1 deletion src/routes/build/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h1 class="text-xl font-semibold text-base-content">Stato delle raccolte</h1>
</div>
<div class="navbar-end flex items-center">
<a class="btn btn-square btn-ghost" title="Indietro" href="/">
<a class="btn btn-square btn-ghost" title="Indietro" href="/" aria-label="Indietro">
<span class="text-primary icon-[akar-icons--arrow-back-thick-fill]"></span>
</a>
</div>
Expand Down