From 7de18e2d44e0793af57504728bff5aed426c00a0 Mon Sep 17 00:00:00 2001 From: Alexander Tesfamichael Date: Fri, 11 Oct 2024 16:02:59 +0200 Subject: [PATCH] feat: remove ts-ignore Ensure value is a number. Expand type to allow getInitialProps. This allows us to remove ts-ignore which Vercel doesn't seem to like. Which leads to a failing build. --- src/mainsite/components/BlobFeesWidget.tsx | 4 ++-- src/pages/_error.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mainsite/components/BlobFeesWidget.tsx b/src/mainsite/components/BlobFeesWidget.tsx index 4fb8b1bf..33e38646 100644 --- a/src/mainsite/components/BlobFeesWidget.tsx +++ b/src/mainsite/components/BlobFeesWidget.tsx @@ -79,8 +79,8 @@ const baseOptions: Highcharts.Options = { fontWeight: "300", }, formatter: function () { - //@ts-ignore - return this.value < 1e-5 ? this.value.toExponential() : this.value; + const value = Number(this.value); + return value < 1e-5 ? value.toExponential() : value; }, }, title: undefined, diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx index ae294a46..01a6e083 100644 --- a/src/pages/_error.tsx +++ b/src/pages/_error.tsx @@ -65,9 +65,7 @@ const ErrorPage: FC<{ error?: Error; statusCode?: number }> = ({ ); }; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: Unreachable code error -ErrorPage.getInitialProps = ({ res, err }: { res: unknown; err: unknown }) => { +(ErrorPage as FC & { getInitialProps: any }).getInitialProps = ({ res, err }: { res: unknown; err: unknown }) => { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const statusCode = res ? (res as { statusCode?: number }).statusCode