diff --git a/apps/web/src/utils/basenames/getDomain.ts b/apps/web/src/utils/basenames/getDomain.ts index 140f67a1fa0..f89236b59d0 100644 --- a/apps/web/src/utils/basenames/getDomain.ts +++ b/apps/web/src/utils/basenames/getDomain.ts @@ -1,7 +1,7 @@ import { isDevelopment } from 'apps/web/src/constants'; import { NextRequest } from 'next/server'; -export function getDomain(request: NextRequest) { +export function getDomain(request: NextRequest): string { return isDevelopment ? `${request.nextUrl.protocol}//${request.nextUrl.host}` : 'https://www.base.org'; diff --git a/apps/web/src/utils/bugsnag.ts b/apps/web/src/utils/bugsnag.ts index 768ca228af4..8a859880a7a 100644 --- a/apps/web/src/utils/bugsnag.ts +++ b/apps/web/src/utils/bugsnag.ts @@ -1,4 +1,3 @@ -// import React from 'react'; import type { BugsnagPluginReactResult } from '@bugsnag/plugin-react'; import type { OnErrorCallback } from '@bugsnag/core/types/common'; diff --git a/apps/web/src/utils/formatEtherPrice.ts b/apps/web/src/utils/formatEtherPrice.ts index 28be3559a21..68d3a6c745e 100644 --- a/apps/web/src/utils/formatEtherPrice.ts +++ b/apps/web/src/utils/formatEtherPrice.ts @@ -1,10 +1,10 @@ import { formatEther } from 'viem'; -export function formatEtherPrice(price?: bigint) { - if (price === undefined) { +export function formatEtherPrice(price?: bigint): number | '...' { + if (!Boolean(price)) { return '...'; } - const value = parseFloat(formatEther(price)); + const value: number = parseFloat(formatEther(price)); if (value < 0.001) { return parseFloat(value.toFixed(4)); } else { diff --git a/apps/web/src/utils/formatUsdPrice.ts b/apps/web/src/utils/formatUsdPrice.ts index 44513a20ecd..8e79e0546e5 100644 --- a/apps/web/src/utils/formatUsdPrice.ts +++ b/apps/web/src/utils/formatUsdPrice.ts @@ -1,8 +1,7 @@ import { formatEther } from 'viem'; -export function formatUsdPrice(price: bigint, ethUsdPrice: number) { +export function formatUsdPrice(price: bigint, ethUsdPrice: number): string { if (price === 0n) return '0'; const parsed = (parseFloat(formatEther(price)) * Number(ethUsdPrice)).toFixed(2); - if (parsed === '0.00') return '0'; - return parsed; + return parsed === '0.00' ? '0' : parsed; } diff --git a/apps/web/src/utils/formatWei.ts b/apps/web/src/utils/formatWei.ts index 5ae0c2ce818..d89797be309 100644 --- a/apps/web/src/utils/formatWei.ts +++ b/apps/web/src/utils/formatWei.ts @@ -1,7 +1,7 @@ import { formatEther, parseEther } from 'viem'; export function formatWei(wei?: bigint): bigint | '...' { - if (wei === undefined) { + if (!Boolean(wei)) { return '...'; } diff --git a/apps/web/src/utils/logEvent.ts b/apps/web/src/utils/logEvent.ts index cf75328cf73..c657defb073 100644 --- a/apps/web/src/utils/logEvent.ts +++ b/apps/web/src/utils/logEvent.ts @@ -5,13 +5,13 @@ declare const window: Window & }; }; -export default function logEvent(name: string, event: unknown) { +export default function logEvent(name: string, event: unknown): void { if (window.ClientAnalytics) { window.ClientAnalytics?.logEvent(name, event); } } -export function identify(event: unknown) { +export function identify(event: unknown): void { if (window.ClientAnalytics) { window.ClientAnalytics?.logEvent('identify', event); } diff --git a/apps/web/src/utils/weiToEth.ts b/apps/web/src/utils/weiToEth.ts index 7efceffc7f8..27593d35e7c 100644 --- a/apps/web/src/utils/weiToEth.ts +++ b/apps/web/src/utils/weiToEth.ts @@ -1,10 +1,10 @@ import { formatEther } from 'viem'; export function weiToEth(wei?: bigint): number | '...' { - if (wei === undefined) { + if (!Boolean(wei)) { return '...'; } - const eth = parseFloat(formatEther(wei)); + const eth: number = parseFloat(formatEther(wei)); if (eth < 0.001) { return parseFloat(eth.toFixed(4)); } else {