From 2bf5722b6b4f5a0fa441e65a9910bad3d96a8cb8 Mon Sep 17 00:00:00 2001 From: Kenneth Trecy Tobias Date: Thu, 14 Mar 2024 21:00:25 +0800 Subject: [PATCH] fix: update most code to adapt new language version --- .eslintrc.cjs | 11 +++++++- playwright.config.ts | 2 +- src/app.d.ts | 18 ++++++++----- .../about_myself/contact_link.svelte | 2 +- src/components/general/card/article.svelte | 2 +- .../general/card/page_detail.svelte | 4 +-- src/components/general/common_head.svelte | 4 +-- .../general/containers/article_post.svelte | 2 +- .../containers/descriptive_list_item.svelte | 8 +++--- .../general/containers/example_code.svelte | 10 +++---- .../containers/example_code_part.svelte | 6 ++--- .../general/containers/example_command.svelte | 5 +--- .../general/containers/example_output.svelte | 4 +-- .../general/containers/keyword.svelte | 2 +- .../reference_info_collection.spec.ts | 2 +- .../containers/reference_info_collection.ts | 2 +- .../general/containers/simple_text.svelte | 2 +- .../containers/structured_article.svelte | 2 +- .../general/containers/structured_list.svelte | 8 +++--- .../containers/structured_list_item.svelte | 8 +++--- .../structured_reference/link.spec.ts | 2 +- .../structured_reference/link.svelte | 2 +- .../containers/structured_section.svelte | 4 +-- src/components/general/headings/base.svelte | 2 +- .../general/headings/primary.spec.ts | 8 +++--- .../general/headings/primary.svelte | 2 +- .../general/headings/quaternary.svelte | 4 +-- .../general/headings/secondary.svelte | 2 +- .../general/headings/subheading.svelte | 4 +-- .../general/headings/tertiary.svelte | 4 +-- src/components/general/links/base.spec.ts | 2 +- src/components/general/links/base.svelte | 2 +- src/components/general/links/bound.svelte | 4 +-- src/components/general/links/citation.svelte | 4 +-- src/components/general/links/constants.ts | 2 +- src/components/general/links/external.svelte | 2 +- .../general/links/unendorsed.svelte | 2 +- src/components/shell.svelte | 12 +++++---- src/components/shell/menu.svelte | 2 +- src/components/shell/profile_link.svelte | 2 +- src/components/shell/theme_toggler.svelte | 10 ++++--- src/constants/article_meta_collection.ts | 2 +- src/constants/associated_file_list.ts | 2 +- src/constants/drive_images.ts | 2 +- src/constants/meta_collection.ts | 2 +- src/constants/redirected_meta_collection.ts | 2 +- src/routes/+error.svelte | 26 +++++++++--------- src/routes/+page.svelte | 2 +- .../[repo]/code/[branch]/[...path]/+server.ts | 4 +-- .../centering_a_child_element/$types.d.ts | 2 +- .../centering_a_child_element/+page.svelte | 11 +++++--- .../centering_a_child_element/+page.ts | 6 ++--- .../shared_constants.ts | 4 +-- .../$types.d.ts | 2 +- .../+page.svelte | 13 ++++++--- .../+page.ts | 6 ++--- .../shared_constants.ts | 2 +- .../+page.svelte | 27 ++++++++++++------- .../$types.d.ts | 2 +- .../+page.svelte | 17 +++++++----- .../+page.ts | 6 ++--- .../shared_constants.ts | 4 +-- src/routes/projects/+page.svelte | 2 +- src/routes/website_info/+page.svelte | 2 +- .../publishing_principles/+page.svelte | 9 ++++--- src/types/content_metadata.ts | 2 +- .../definers/define_article_page_meta.spec.ts | 2 +- .../definers/define_article_page_meta.ts | 2 +- .../definers/define_heading_info.spec.ts | 2 +- src/utilities/definers/define_heading_info.ts | 2 +- .../definers/define_page_meta.spec.ts | 2 +- src/utilities/definers/define_page_meta.ts | 2 +- src/utilities/mocker.ts | 2 +- .../resource/flatten_owner_tree_info.spec.ts | 2 +- .../resource/flatten_owner_tree_info.ts | 2 +- src/utilities/resource/make_set.spec.ts | 2 +- src/utilities/resource/make_set.ts | 2 +- vite.config.ts | 2 +- 78 files changed, 200 insertions(+), 165 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f26306ef..610675f8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -35,5 +35,14 @@ module.exports = { "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:svelte/recommended", "whitelistyle" - ] + ], + "rules": { + "init-declarations": [ "off" ], + "sort-imports": [ "off" ], + "max-len": [ "off" ], + "max-lines": [ "warn" ], + "no-undefined": [ "off" ], + "no-undef-init": [ "off" ], + "@typescript-eslint/restrict-template-expressions": [ "off" ] + } } diff --git a/playwright.config.ts b/playwright.config.ts index efff4415..469e55c9 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,4 +1,4 @@ -import type { PlaywrightTestConfig } from "@playwright/test" +import { type PlaywrightTestConfig } from "@playwright/test" const configuration: PlaywrightTestConfig = { "webServer": { diff --git a/src/app.d.ts b/src/app.d.ts index 50ac62fc..68f61908 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,11 +1,15 @@ -// See https://kit.svelte.dev/docs/types#app -// for information about these interfaces -// and what to do when importing types +/* + * See https://kit.svelte.dev/docs/types#app + * for information about these interfaces + * and what to do when importing types + */ declare namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} + /* + * Interface Error {} + * interface Locals {} + * interface PageData {} + * interface PageState {} + */ interface Platform { env: { PUBLIC_PRODUCTION_BASE_URL: string diff --git a/src/components/about_myself/contact_link.svelte b/src/components/about_myself/contact_link.svelte index 99b5ccdb..f242c882 100644 --- a/src/components/about_myself/contact_link.svelte +++ b/src/components/about_myself/contact_link.svelte @@ -1,5 +1,5 @@ diff --git a/src/components/general/containers/structured_list.svelte b/src/components/general/containers/structured_list.svelte index 0ea1ee47..01f85a83 100644 --- a/src/components/general/containers/structured_list.svelte +++ b/src/components/general/containers/structured_list.svelte @@ -1,11 +1,11 @@ diff --git a/src/components/shell.svelte b/src/components/shell.svelte index b815fe20..12d18dbb 100644 --- a/src/components/shell.svelte +++ b/src/components/shell.svelte @@ -4,18 +4,20 @@ import Logo from "@/multimedia/logo.png" import { LICENSE, LICENSE_URL } from "@/constants/miscellaneous_meta" - import Menu from "@/components/shell/menu.svelte" + import ExternalLink from "@/components/general/links/external.svelte" import Icon from "@/components/general/icon.svelte" + import Menu from "@/components/shell/menu.svelte" import ProfileLink from "@/components/shell/profile_link.svelte" - import toggleBySpace from "@/utilities/toggle_by_space" - import ThemeToggler from "@/components/shell/theme_toggler.svelte" - import ExternalLink from "@/components/general/links/external.svelte" import SimpleText from "@/components/general/containers/simple_text.svelte" + import ThemeToggler from "@/components/shell/theme_toggler.svelte" + import toggleBySpace from "@/utilities/toggle_by_space" let isMenuShown = false function toggleMenu(event: KeyboardEvent): void { - toggleBySpace(event, () => isMenuShown = !isMenuShown) + toggleBySpace(event, () => { + isMenuShown = !isMenuShown + }) } diff --git a/src/components/shell/menu.svelte b/src/components/shell/menu.svelte index bd742db9..74f69ede 100644 --- a/src/components/shell/menu.svelte +++ b/src/components/shell/menu.svelte @@ -6,7 +6,7 @@ import Icon from "@/components/general/icon.svelte" import BaseLink from "@/components/general/links/base.svelte" - export let mustShowHorizontally: boolean = false + export let mustShowHorizontally = false const linkClasses = [ "inline-flex", "flex-row", "flex-nowrap", "items-center", "no-underline" ] diff --git a/src/components/shell/profile_link.svelte b/src/components/shell/profile_link.svelte index 7a2d71ab..5453c5c9 100644 --- a/src/components/shell/profile_link.svelte +++ b/src/components/shell/profile_link.svelte @@ -1,5 +1,5 @@