diff --git a/app/lib/conf2023.server.ts b/app/lib/conf2023.server.ts index 7260f05f..9450874d 100644 --- a/app/lib/conf2023.server.ts +++ b/app/lib/conf2023.server.ts @@ -78,7 +78,7 @@ export async function getSpeakers( .map((speaker: unknown) => { try { validateSessionizeSpeakerData(speaker); - } catch (error) { + } catch { console.warn( `Invalid speaker object; skipping.\n\nSee API settings to ensure expected data is included: ${SESSIONIZE_API_DETAILS_URL}\n\n`, "Received:\n", @@ -158,7 +158,7 @@ export async function getConfSessions( flatSessions.set(session.id, modelSpeakerSession(session)); } return Array.from(flatSessions.values()); - } catch (error) { + } catch { return null; } }) @@ -286,7 +286,7 @@ export async function getSchedules( // flatSessions.set(session.id, modelSpeakerSession(session)); // } // return Array.from(flatSessions.values()); - } catch (error) { + } catch { return null; } }) diff --git a/app/lib/gh-docs/repo-tarball.ts b/app/lib/gh-docs/repo-tarball.ts index 52227c2c..99e00afd 100644 --- a/app/lib/gh-docs/repo-tarball.ts +++ b/app/lib/gh-docs/repo-tarball.ts @@ -32,7 +32,7 @@ export async function getRepoTarballStream( return res; } throw new Error(`Could not fetch ${tarballURL}`); - } catch (err) { + } catch { throw new Error(`Could not fetch ${tarballURL}`); } } diff --git a/app/lib/http.server.ts b/app/lib/http.server.ts index 2a4a2530..bd05b314 100644 --- a/app/lib/http.server.ts +++ b/app/lib/http.server.ts @@ -85,7 +85,7 @@ function getValidRedirectCode(code: string | number | undefined) { if (typeof code === "string") { try { code = parseInt(code.trim(), 10); - } catch (_) { + } catch { return defaultCode; } } diff --git a/app/lib/resources.server/index.ts b/app/lib/resources.server/index.ts index 0d655f16..7646cb7f 100644 --- a/app/lib/resources.server/index.ts +++ b/app/lib/resources.server/index.ts @@ -168,7 +168,7 @@ async function getSponsorUrl(owner: string) { // method: "HEAD" removes the need for garbage collection: https://github.com/nodejs/undici?tab=readme-ov-file#garbage-collection let response = await fetch(sponsorUrl, { method: "HEAD" }); return !response.redirected ? sponsorUrl : undefined; - } catch (e) { + } catch { console.error("Failed to fetch sponsor url for", owner); return undefined; } diff --git a/app/routes/$.tsx b/app/routes/$.tsx index 280498d5..fb1dbe9a 100644 --- a/app/routes/$.tsx +++ b/app/routes/$.tsx @@ -63,7 +63,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => { // cache but we should probably fix it anyway. return redirect(`/docs/${lang}/${ref}/${params["*"]}`); // eslint-disable-next-line no-empty -- should probably do something here - } catch (_) {} + } catch {} throw data({}, { status: 404 }); }; diff --git a/app/routes/_extras.blog._index.tsx b/app/routes/_extras.blog._index.tsx index 00535cbd..d88e8f8f 100644 --- a/app/routes/_extras.blog._index.tsx +++ b/app/routes/_extras.blog._index.tsx @@ -1,10 +1,10 @@ import * as React from "react"; -import type { LoaderFunctionArgs, MetaFunction } from "react-router"; +import type { MetaFunction } from "react-router"; import { useLoaderData, Link } from "react-router"; import { Subscribe } from "~/ui/subscribe"; import { getBlogPostListings } from "~/lib/blog.server"; -export const loader = async (_: LoaderFunctionArgs) => { +export const loader = async () => { return { posts: await getBlogPostListings() }; }; diff --git a/app/routes/conf.2022._inner.venue.tsx b/app/routes/conf.2022._inner.venue.tsx index 35eb1c98..01cd7315 100644 --- a/app/routes/conf.2022._inner.venue.tsx +++ b/app/routes/conf.2022._inner.venue.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import type { LoaderFunctionArgs, MetaFunction } from "react-router"; +import type { MetaFunction } from "react-router"; import { useLoaderData, Link } from "react-router"; import { primaryButtonLinkClass } from "~/ui/buttons"; @@ -25,7 +25,7 @@ const hotelImages = [ ]; const TOTAL_HOTEL_IMAGES = hotelImages.length; -export const loader = async (_: LoaderFunctionArgs) => { +export const loader = async () => { return { hotelImageNumber: Math.floor(Math.random() * TOTAL_HOTEL_IMAGES) + 1, }; diff --git a/app/routes/conf.2023._inner.schedule.tsx b/app/routes/conf.2023._inner.schedule.tsx index ea554ac0..9ec74f91 100644 --- a/app/routes/conf.2023._inner.schedule.tsx +++ b/app/routes/conf.2023._inner.schedule.tsx @@ -6,13 +6,13 @@ import { useNavigation, data, } from "react-router"; -import type { MetaFunction, LoaderFunctionArgs } from "react-router"; +import type { MetaFunction } from "react-router"; import cx from "clsx"; import { formatDate, getSchedules } from "~/lib/conf2023.server"; import { CACHE_CONTROL } from "~/lib/http.server"; import { slugify } from "~/ui/primitives/utils"; -export async function loader(_: LoaderFunctionArgs) { +export async function loader() { let schedules = await getSchedules(); let formatter = new Intl.ListFormat("en", { style: "long", diff --git a/app/routes/conf.2023.tsx b/app/routes/conf.2023.tsx index 732b9026..9e13bfca 100644 --- a/app/routes/conf.2023.tsx +++ b/app/routes/conf.2023.tsx @@ -6,7 +6,6 @@ import { useMatches, data, } from "react-router"; -import type { LoaderFunctionArgs } from "react-router"; import { Link, NavLink } from "~/ui/link"; import { Wordmark } from "~/ui/logo"; import { Discord, GitHub, Twitter, YouTube } from "~/ui/icons"; @@ -34,7 +33,7 @@ export const handle = { forceDark: true }; // March 1 at 12:00am const EARLY_BIRD_ENDING_TIME = 1646121600000; -export const loader = async (_: LoaderFunctionArgs) => { +export const loader = async () => { return data( { earlyBird: Date.now() < EARLY_BIRD_ENDING_TIME }, { headers: { "Cache-Control": CACHE_CONTROL.conf } }, @@ -219,7 +218,7 @@ function isExternalUrl(value: string, currentHost: string) { try { let url = new URL(value); return url.host !== currentHost; - } catch (err) { + } catch { return false; } } diff --git a/app/routes/docs.$lang.$ref.$.tsx b/app/routes/docs.$lang.$ref.$.tsx index f7cfa1e0..d6dd25cb 100644 --- a/app/routes/docs.$lang.$ref.$.tsx +++ b/app/routes/docs.$lang.$ref.$.tsx @@ -41,7 +41,7 @@ export async function loader({ params, request }: LoaderFunctionArgs) { { doc, siteUrl, ogImageUrl }, { headers: { "Cache-Control": CACHE_CONTROL.DEFAULT } }, ); - } catch (_) { + } catch { if (params.ref === "main" && params["*"]) { // Only perform redirects for 404's on `main` URLs which are likely being // redirected from the root `/docs/{slug}`. If someone is direct linking diff --git a/app/ui/subscribe.tsx b/app/ui/subscribe.tsx index 63356c1d..04550c8f 100644 --- a/app/ui/subscribe.tsx +++ b/app/ui/subscribe.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useFetcher } from "react-router"; -import type { FormProps, FetcherWithComponents } from "react-router"; +import type { FormProps } from "react-router"; import { Button, Input } from "./buttons"; import cx from "clsx"; import type { action } from "~/routes/[_]actions.newsletter"; @@ -196,7 +196,7 @@ function useComposedRefs(...refs: React.Ref[]) { try { (ref as React.MutableRefObject).current = node; // eslint-disable-next-line no-empty -- this is fine, right? - } catch (_) {} + } catch {} } }); },