From 70b4417128c7c6f9818cba22cd7156ca31d3b25b Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 20 Apr 2023 09:29:47 +0200 Subject: [PATCH] fix(frontend): fix eslint errors --- frontend/src/lib/components/IconButton.svelte | 4 ++-- frontend/src/lib/store.ts | 2 +- frontend/src/routes/@[username]/+page.svelte | 2 +- frontend/src/routes/edit/EditableField.svelte | 2 +- frontend/src/routes/edit/EditablePronouns.svelte | 1 - frontend/src/routes/nav/Navigation.svelte | 2 +- frontend/src/routes/reports/ReportCard.svelte | 2 +- frontend/src/routes/settings/tokens/+page.svelte | 2 +- frontend/src/routes/settings/warnings/+page.svelte | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/lib/components/IconButton.svelte b/frontend/src/lib/components/IconButton.svelte index cfbb617..f340cfc 100644 --- a/frontend/src/lib/components/IconButton.svelte +++ b/frontend/src/lib/components/IconButton.svelte @@ -4,8 +4,8 @@ export let icon: string; export let color: "primary" | "secondary" | "success" | "danger"; export let tooltip: string; - export let active: boolean = false; - export let disabled: boolean = false; + export let active = false; + export let disabled = false; export let type: string | undefined = undefined; export let id: string | undefined = undefined; diff --git a/frontend/src/lib/store.ts b/frontend/src/lib/store.ts index 492b0c7..99a94d8 100644 --- a/frontend/src/lib/store.ts +++ b/frontend/src/lib/store.ts @@ -6,7 +6,7 @@ import type { MeUser } from "./api/entities"; const initialUserValue = null; export const userStore = writable(initialUserValue); -let defaultThemeValue = "dark"; +const defaultThemeValue = "dark"; const initialThemeValue = browser ? window.localStorage.getItem("pronouns-theme") ?? defaultThemeValue : defaultThemeValue; diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte index 07d072c..ad06da9 100644 --- a/frontend/src/routes/@[username]/+page.svelte +++ b/frontend/src/routes/@[username]/+page.svelte @@ -43,7 +43,7 @@ let bio: string | null; $: bio = renderMarkdown(data.bio); - let memberPage: number = 0; + let memberPage = 0; let memberSlice: PartialMember[] = []; $: memberSlice = data.members.slice(memberPage * 20, (memberPage + 1) * 20); const totalPages = Math.ceil(data.members.length / 20); diff --git a/frontend/src/routes/edit/EditableField.svelte b/frontend/src/routes/edit/EditableField.svelte index 66be6c9..1c3f229 100644 --- a/frontend/src/routes/edit/EditableField.svelte +++ b/frontend/src/routes/edit/EditableField.svelte @@ -9,7 +9,7 @@ export let deleteField: () => void; export let moveField: (up: boolean) => void; - let newEntry: string = ""; + let newEntry = ""; const addEntry = (event: Event) => { event.preventDefault(); diff --git a/frontend/src/routes/edit/EditablePronouns.svelte b/frontend/src/routes/edit/EditablePronouns.svelte index d1a1548..5179a81 100644 --- a/frontend/src/routes/edit/EditablePronouns.svelte +++ b/frontend/src/routes/edit/EditablePronouns.svelte @@ -3,7 +3,6 @@ import type { Pronoun, CustomPreference, CustomPreferences } from "$lib/api/entities"; import IconButton from "$lib/components/IconButton.svelte"; import { - Button, ButtonDropdown, Collapse, DropdownItem, diff --git a/frontend/src/routes/nav/Navigation.svelte b/frontend/src/routes/nav/Navigation.svelte index 2b2c33b..ef1e992 100644 --- a/frontend/src/routes/nav/Navigation.svelte +++ b/frontend/src/routes/nav/Navigation.svelte @@ -31,7 +31,7 @@ let theme: string; let currentUser: MeUser | null; - let showMenu: boolean = false; + let showMenu = false; let isAdmin = false; let numReports = 0; diff --git a/frontend/src/routes/reports/ReportCard.svelte b/frontend/src/routes/reports/ReportCard.svelte index ac1718c..6af81b7 100644 --- a/frontend/src/routes/reports/ReportCard.svelte +++ b/frontend/src/routes/reports/ReportCard.svelte @@ -1,7 +1,7 @@ diff --git a/frontend/src/routes/settings/tokens/+page.svelte b/frontend/src/routes/settings/tokens/+page.svelte index f0f8e29..1e0f585 100644 --- a/frontend/src/routes/settings/tokens/+page.svelte +++ b/frontend/src/routes/settings/tokens/+page.svelte @@ -1,6 +1,6 @@