From ebc9343e8f9b33220be8b04a8ffe76b4a1342180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Guzm=C3=A1n?= <20783123+mateoguzmana@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:33:07 +0200 Subject: [PATCH] fix(types): adding correct redirect-home props to fix some ts-ignores (#50810) Co-authored-by: Oliver Eyton-Williams --- client/src/components/create-redirect.ts | 4 ++-- client/src/pages/certification.tsx | 5 ++--- client/src/pages/settings.tsx | 5 ++--- client/src/pages/unsubscribed.tsx | 5 ++--- client/src/pages/user.tsx | 5 ++--- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/client/src/components/create-redirect.ts b/client/src/components/create-redirect.ts index 41d3cfc564c..5186cfa12f4 100644 --- a/client/src/components/create-redirect.ts +++ b/client/src/components/create-redirect.ts @@ -1,8 +1,8 @@ -/* eslint-disable react/display-name */ import { navigate } from 'gatsby'; +import type { RouteComponentProps } from '@reach/router'; const createRedirect = - (to = '/'): (() => JSX.Element | null) => + (to = '/'): ((_props: RouteComponentProps) => JSX.Element | null) => () => { if (typeof window !== 'undefined') { void navigate(to); diff --git a/client/src/pages/certification.tsx b/client/src/pages/certification.tsx index 50660e41c76..dde424ceda4 100644 --- a/client/src/pages/certification.tsx +++ b/client/src/pages/certification.tsx @@ -16,9 +16,8 @@ function Certification(): JSX.Element { // @ts-ignore path={withPrefix('/certification/:username/:certSlug')} /> - {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} - {/* @ts-ignore */} - + + ); } diff --git a/client/src/pages/settings.tsx b/client/src/pages/settings.tsx index 95a19aec6aa..9ab043dc866 100644 --- a/client/src/pages/settings.tsx +++ b/client/src/pages/settings.tsx @@ -9,9 +9,8 @@ function Settings(): JSX.Element { return ( - {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} - {/* @ts-ignore */} - + + ); } diff --git a/client/src/pages/unsubscribed.tsx b/client/src/pages/unsubscribed.tsx index 55f39702b84..8ed76294e92 100644 --- a/client/src/pages/unsubscribed.tsx +++ b/client/src/pages/unsubscribed.tsx @@ -14,9 +14,8 @@ function Unsubscribed(): JSX.Element { {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} {/* @ts-ignore */} - {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} - {/* @ts-ignore */} - + + ); } diff --git a/client/src/pages/user.tsx b/client/src/pages/user.tsx index 03559eafa80..a24ad543733 100644 --- a/client/src/pages/user.tsx +++ b/client/src/pages/user.tsx @@ -10,9 +10,8 @@ function User(): JSX.Element { {/* @ts-expect-error Adding path property breaks username typing */} - {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} - {/* @ts-ignore */} - + + ); }