diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 7f42f444b9..810fa3d18b 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -14,7 +14,11 @@ module.exports = { // Unused vars that start with an understore are allowed to be unused: "@typescript-eslint/no-unused-vars": [ "warn", - { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, ], // Weirdly this rule does not get set by ESLint's recommended ruleset, // but we try to avoid implicitly casting values (see e.g. reviews of diff --git a/frontend/src/components/Image.tsx b/frontend/src/components/Image.tsx index 3e94c7c2b2..eca32ede44 100644 --- a/frontend/src/components/Image.tsx +++ b/frontend/src/components/Image.tsx @@ -8,11 +8,11 @@ // with // import Image from next/image; -import NextImage, { getImageProps } from "next/image"; +import _NextImage, { getImageProps } from "next/image"; import { ComponentProps } from "react"; import styles from "./Image.module.scss"; -export default function Image(props: ComponentProps) { +export default function Image(props: ComponentProps) { const altText = props.alt; const { props: nextProps } = getImageProps({ ...props }); const { style, className: origClassName, ...delegated } = nextProps; diff --git a/frontend/src/components/dashboard/FreeOnboarding.tsx b/frontend/src/components/dashboard/FreeOnboarding.tsx index d74539d34d..5173806a6d 100644 --- a/frontend/src/components/dashboard/FreeOnboarding.tsx +++ b/frontend/src/components/dashboard/FreeOnboarding.tsx @@ -93,7 +93,7 @@ export const FreeOnboarding = (props: Props) => { try { await props.generateNewMask({ mask_type: "random" }); - } catch (e) { + } catch (_e) { // On error, we can only move to the next step if the user has atleast 1 mask. if (!props.hasAtleastOneMask) { moveToNextStep = false; diff --git a/frontend/src/components/waitlist/WaitlistPage.tsx b/frontend/src/components/waitlist/WaitlistPage.tsx index 16bfe4c16d..dba5a83cb0 100644 --- a/frontend/src/components/waitlist/WaitlistPage.tsx +++ b/frontend/src/components/waitlist/WaitlistPage.tsx @@ -90,7 +90,7 @@ export const WaitlistPage = (props: Props) => { type: "error", }); } - } catch (error) { + } catch (_error) { toast(l10n.getString("waitlist-subscribe-error-connection"), { type: "error", }); diff --git a/frontend/src/pages/accounts/profile.page.tsx b/frontend/src/pages/accounts/profile.page.tsx index e4d7694808..bd747926e1 100644 --- a/frontend/src/pages/accounts/profile.page.tsx +++ b/frontend/src/pages/accounts/profile.page.tsx @@ -186,7 +186,7 @@ const Profile: NextPage = () => { setAliasGeneratedState(true); } addonData.sendEvent("aliasListUpdate"); - } catch { + } catch (_error) { // TODO: Refactor CustomAddressGenerationModal to remove the setAliasGeneratedState callback, and instead use a try catch block. if (setAliasGeneratedState) { setAliasGeneratedState(false); @@ -210,7 +210,7 @@ const Profile: NextPage = () => { "Immediately caught to land in the same code path as failed requests.", ); } - } catch (error) { + } catch (_error) { toast( l10n.getString("error-mask-update-failed", { alias: getFullAddress(alias), @@ -229,7 +229,7 @@ const Profile: NextPage = () => { ); } addonData.sendEvent("aliasListUpdate"); - } catch (error: unknown) { + } catch (_error: unknown) { toast( l10n.getString("error-mask-delete-failed", { alias: getFullAddress(alias), diff --git a/frontend/src/pages/accounts/settings.page.tsx b/frontend/src/pages/accounts/settings.page.tsx index 87e380fcd8..c41449124f 100644 --- a/frontend/src/pages/accounts/settings.page.tsx +++ b/frontend/src/pages/accounts/settings.page.tsx @@ -134,7 +134,7 @@ const Settings: NextPage = () => { // notify the add-on about it: addonData.sendEvent("serverStorageChange"); } - } catch (e) { + } catch (_e) { toast(l10n.getString("error-settings-update"), { type: "error" }); } }; diff --git a/frontend/src/pages/contains-tracker-warning.page.tsx b/frontend/src/pages/contains-tracker-warning.page.tsx index b3b403ce0d..e7e1ad6643 100644 --- a/frontend/src/pages/contains-tracker-warning.page.tsx +++ b/frontend/src/pages/contains-tracker-warning.page.tsx @@ -177,7 +177,7 @@ function parseHash(hash: string): TrackerWarningData | null { received_at: data.received_at, original_link: data.original_link, }; - } catch (e) { + } catch (_e) { return null; } } diff --git a/frontend/src/pages/tracker-report.page.tsx b/frontend/src/pages/tracker-report.page.tsx index c4831a0e57..934779f704 100644 --- a/frontend/src/pages/tracker-report.page.tsx +++ b/frontend/src/pages/tracker-report.page.tsx @@ -246,7 +246,7 @@ function parseHash(hash: string): ReportData | null { received_at: data.received_at, trackers: data.trackers, }; - } catch (e) { + } catch (_e) { return null; } }