From c3de10b8bb344f6271c5ca585672b4c26fa666bc Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Mon, 30 Jan 2023 00:02:39 -0500 Subject: [PATCH] clean up warnings --- components/Header.tsx | 2 +- scripts/FavoriteSearch.ts | 4 ++-- scripts/History.ts | 1 + scripts/Index.ts | 4 ++-- scripts/ScrollHeader.ts | 4 ++-- scripts/Story.ts | 4 ++-- scripts/StoryProgressSaving.ts | 4 ++-- templates/Story.tsx | 41 +++++++++++++++++----------------- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/components/Header.tsx b/components/Header.tsx index 705076f..1ece605 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -7,7 +7,7 @@ interface BaseHeaderProps extends Props { entries: { name: string; href: string; - element?: any; + element?: unknown; }[]; currentHref: string; } diff --git a/scripts/FavoriteSearch.ts b/scripts/FavoriteSearch.ts index a381eda..c42a12c 100644 --- a/scripts/FavoriteSearch.ts +++ b/scripts/FavoriteSearch.ts @@ -4,8 +4,8 @@ interface SavedSearch { } export default () => { - let oldOnloadHandler: Function; - oldOnloadHandler = window.onload ?? (() => {}); + // deno-lint-ignore ban-types + const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = () => { oldOnloadHandler(); diff --git a/scripts/History.ts b/scripts/History.ts index 3fdb4d4..f111bd1 100644 --- a/scripts/History.ts +++ b/scripts/History.ts @@ -7,6 +7,7 @@ */ export default () => { + // deno-lint-ignore ban-types const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = async () => { diff --git a/scripts/Index.ts b/scripts/Index.ts index da9fb1f..9fd7a5f 100644 --- a/scripts/Index.ts +++ b/scripts/Index.ts @@ -11,8 +11,8 @@ interface SavedStory { } export default () => { - let oldOnloadHandler: Function; - oldOnloadHandler = window.onload ?? (() => {}); + // deno-lint-ignore ban-types + const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = () => { oldOnloadHandler(); diff --git a/scripts/ScrollHeader.ts b/scripts/ScrollHeader.ts index 91bd666..ef26098 100644 --- a/scripts/ScrollHeader.ts +++ b/scripts/ScrollHeader.ts @@ -1,6 +1,6 @@ export default () => { - let oldOnloadHandler: Function; - oldOnloadHandler = window.onload ?? (() => {}); + // deno-lint-ignore ban-types + const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = () => { oldOnloadHandler(); diff --git a/scripts/Story.ts b/scripts/Story.ts index 45575f7..b96abf6 100644 --- a/scripts/Story.ts +++ b/scripts/Story.ts @@ -6,8 +6,8 @@ interface SavedStory { } export default () => { - let oldOnloadHandler: Function; - oldOnloadHandler = window.onload ?? (() => {}); + // deno-lint-ignore ban-types + const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = () => { oldOnloadHandler(); diff --git a/scripts/StoryProgressSaving.ts b/scripts/StoryProgressSaving.ts index 9842104..7110eb7 100644 --- a/scripts/StoryProgressSaving.ts +++ b/scripts/StoryProgressSaving.ts @@ -1,6 +1,6 @@ export default () => { - let oldOnloadHandler: Function; - oldOnloadHandler = window.onload ?? (() => {}); + // deno-lint-ignore ban-types + const oldOnloadHandler: Function = window.onload ?? (() => {}); window.onload = () => { oldOnloadHandler(); diff --git a/templates/Story.tsx b/templates/Story.tsx index b5cc81a..d912942 100644 --- a/templates/Story.tsx +++ b/templates/Story.tsx @@ -13,26 +13,27 @@ interface StoryProps { } export default (props: PropsWithChildren) => { - let chaptersInHeader: { name: string; href: string; element?: any }[] = [ - { - name: "Homepage", - href: `/` - }, - { - name: "", - href: "", - element: - }, - { - name: "Details", - href: `/story?id=${props.story.id}` - }, - { - name: "", - href: "", - element: - } - ]; + let chaptersInHeader: { name: string; href: string; element?: unknown }[] = + [ + { + name: "Homepage", + href: `/` + }, + { + name: "", + href: "", + element: + }, + { + name: "Details", + href: `/story?id=${props.story.id}` + }, + { + name: "", + href: "", + element: + } + ]; chaptersInHeader = chaptersInHeader.concat( props.story.chapters.map((ch, i) => ({