Skip to content

Commit

Permalink
Remove unused vars and types (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeiscontent authored Nov 14, 2024
1 parent 7bae15a commit 8112ab8
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/lib/conf2023.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -158,7 +158,7 @@ export async function getConfSessions(
flatSessions.set(session.id, modelSpeakerSession(session));
}
return Array.from(flatSessions.values());
} catch (error) {
} catch {
return null;
}
})
Expand Down Expand Up @@ -286,7 +286,7 @@ export async function getSchedules(
// flatSessions.set(session.id, modelSpeakerSession(session));
// }
// return Array.from(flatSessions.values());
} catch (error) {
} catch {
return null;
}
})
Expand Down
2 changes: 1 addition & 1 deletion app/lib/gh-docs/repo-tarball.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/http.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function getValidRedirectCode(code: string | number | undefined) {
if (typeof code === "string") {
try {
code = parseInt(code.trim(), 10);
} catch (_) {
} catch {
return defaultCode;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/resources.server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
};

Expand Down
4 changes: 2 additions & 2 deletions app/routes/_extras.blog._index.tsx
Original file line number Diff line number Diff line change
@@ -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() };
};

Expand Down
4 changes: 2 additions & 2 deletions app/routes/conf.2022._inner.venue.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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,
};
Expand Down
4 changes: 2 additions & 2 deletions app/routes/conf.2023._inner.schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions app/routes/conf.2023.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 } },
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/docs.$lang.$ref.$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions app/ui/subscribe.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -94,6 +94,7 @@ const SubscribeInput = React.forwardRef<
>(
(
{
children,

Check warning on line 97 in app/ui/subscribe.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Lint

'children' is defined but never used
className = "w-full sm:w-auto sm:flex-1 dark:placeholder-gray-500",
...props
},
Expand Down Expand Up @@ -196,7 +197,7 @@ function useComposedRefs<T>(...refs: React.Ref<T>[]) {
try {
(ref as React.MutableRefObject<T | null>).current = node;
// eslint-disable-next-line no-empty -- this is fine, right?
} catch (_) {}
} catch {}
}
});
},
Expand Down

0 comments on commit 8112ab8

Please sign in to comment.