From c189a04a1bc5b4b8201bb2519399cc575661f3e2 Mon Sep 17 00:00:00 2001 From: defispartan Date: Tue, 14 Jan 2025 23:41:02 -0600 Subject: [PATCH] chore: lint --- src/components/HistoricalAPYRow.tsx | 2 +- src/hooks/useHistoricalAPYData.ts | 8 ++++---- src/modules/markets/MarketAssetsListContainer.tsx | 5 ++--- src/modules/markets/MarketAssetsListItem.tsx | 2 +- src/modules/markets/MarketAssetsListMobileItem.tsx | 2 +- src/modules/markets/index-current-query.ts | 4 ++-- src/modules/markets/index-history-query.ts | 4 ++-- src/store/protocolDataSlice.ts | 4 ++-- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/HistoricalAPYRow.tsx b/src/components/HistoricalAPYRow.tsx index 7e9decb984..46eca782e0 100644 --- a/src/components/HistoricalAPYRow.tsx +++ b/src/components/HistoricalAPYRow.tsx @@ -16,7 +16,7 @@ export const reserveHistoricalRateTimeRangeOptions = [ ESupportedAPYTimeRanges.OneYear, ]; -export type ReserveHistoricalRateTimeRange = typeof reserveHistoricalRateTimeRangeOptions[number]; +export type ReserveHistoricalRateTimeRange = (typeof reserveHistoricalRateTimeRangeOptions)[number]; export interface TimeRangeSelectorProps { disabled?: boolean; diff --git a/src/hooks/useHistoricalAPYData.ts b/src/hooks/useHistoricalAPYData.ts index fbc50b0d14..c851f5c03d 100644 --- a/src/hooks/useHistoricalAPYData.ts +++ b/src/hooks/useHistoricalAPYData.ts @@ -20,15 +20,15 @@ interface Rates { function calculateImpliedAPY( currentLiquidityIndex: number, previousLiquidityIndex: number, - daysBetweenIndexes: number, + daysBetweenIndexes: number ): string { if (previousLiquidityIndex <= 0 || currentLiquidityIndex <= 0) { - throw new Error("Liquidity indexes must be positive values."); + throw new Error('Liquidity indexes must be positive values.'); } const growthFactor = currentLiquidityIndex / previousLiquidityIndex; const annualizedGrowthFactor = Math.pow(growthFactor, 365 / daysBetweenIndexes); - const impliedAPY = (annualizedGrowthFactor - 1); + const impliedAPY = annualizedGrowthFactor - 1; return impliedAPY.toString(); } @@ -165,6 +165,6 @@ export const useHistoricalAPYData = ( queryKey: ['historicalAPYData', subgraphUrl, selectedTimeRange, underlyingAssets], queryFn: () => fetchHistoricalAPYData(subgraphUrl, selectedTimeRange, underlyingAssets), staleTime: 5 * 60 * 1000, // 5 minutes - refetchInterval: 5 * 60 * 1000, // 5 minutes + refetchInterval: 5 * 60 * 1000, // 5 minutes }); }; diff --git a/src/modules/markets/MarketAssetsListContainer.tsx b/src/modules/markets/MarketAssetsListContainer.tsx index f4b290ab59..9c615ddef2 100644 --- a/src/modules/markets/MarketAssetsListContainer.tsx +++ b/src/modules/markets/MarketAssetsListContainer.tsx @@ -2,15 +2,15 @@ import { API_ETH_MOCK_ADDRESS } from '@aave/contract-helpers'; import { Trans } from '@lingui/macro'; import { Box, Switch, Typography, useMediaQuery, useTheme } from '@mui/material'; import { useState } from 'react'; +import { ESupportedAPYTimeRanges, HistoricalAPYRow } from 'src/components/HistoricalAPYRow'; import { ListWrapper } from 'src/components/lists/ListWrapper'; import { NoSearchResults } from 'src/components/NoSearchResults'; import { Link } from 'src/components/primitives/Link'; import { Warning } from 'src/components/primitives/Warning'; import { TitleWithSearchBar } from 'src/components/TitleWithSearchBar'; import { useAppDataContext } from 'src/hooks/app-data-provider/useAppDataProvider'; -import MarketAssetsList from 'src/modules/markets/MarketAssetsList'; import { useHistoricalAPYData } from 'src/hooks/useHistoricalAPYData'; - +import MarketAssetsList from 'src/modules/markets/MarketAssetsList'; import { useRootStore } from 'src/store/root'; import { fetchIconSymbolAndName } from 'src/ui-config/reservePatches'; import { getGhoReserve, GHO_MINTING_MARKETS, GHO_SYMBOL } from 'src/utils/ghoUtilities'; @@ -18,7 +18,6 @@ import { useShallow } from 'zustand/shallow'; import { GENERAL } from '../../utils/mixPanelEvents'; import { GhoBanner } from './Gho/GhoBanner'; -import { ESupportedAPYTimeRanges, HistoricalAPYRow } from 'src/components/HistoricalAPYRow'; function shouldDisplayGhoBanner(marketTitle: string, searchTerm: string): boolean { // GHO banner is only displayed on markets where new GHO is mintable (i.e. Ethereum) diff --git a/src/modules/markets/MarketAssetsListItem.tsx b/src/modules/markets/MarketAssetsListItem.tsx index 509a6de573..953c0d7b39 100644 --- a/src/modules/markets/MarketAssetsListItem.tsx +++ b/src/modules/markets/MarketAssetsListItem.tsx @@ -2,6 +2,7 @@ import { ProtocolAction } from '@aave/contract-helpers'; import { Trans } from '@lingui/macro'; import { Box, Button, Typography } from '@mui/material'; import { useRouter } from 'next/router'; +import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; import { OffboardingTooltip } from 'src/components/infoTooltips/OffboardingToolTip'; import { RenFILToolTip } from 'src/components/infoTooltips/RenFILToolTip'; import { SpkAirdropTooltip } from 'src/components/infoTooltips/SpkAirdropTooltip'; @@ -23,7 +24,6 @@ import { FormattedNumber } from '../../components/primitives/FormattedNumber'; import { Link, ROUTES } from '../../components/primitives/Link'; import { TokenIcon } from '../../components/primitives/TokenIcon'; import { ComputedReserveData } from '../../hooks/app-data-provider/useAppDataProvider'; -import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => { const router = useRouter(); diff --git a/src/modules/markets/MarketAssetsListMobileItem.tsx b/src/modules/markets/MarketAssetsListMobileItem.tsx index d6f9e036e1..86d77d7d2f 100644 --- a/src/modules/markets/MarketAssetsListMobileItem.tsx +++ b/src/modules/markets/MarketAssetsListMobileItem.tsx @@ -1,6 +1,7 @@ import { ProtocolAction } from '@aave/contract-helpers'; import { Trans } from '@lingui/macro'; import { Box, Button, Divider } from '@mui/material'; +import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; import { SpkAirdropTooltip } from 'src/components/infoTooltips/SpkAirdropTooltip'; import { SuperFestTooltip } from 'src/components/infoTooltips/SuperFestTooltip'; import { VariableAPYTooltip } from 'src/components/infoTooltips/VariableAPYTooltip'; @@ -17,7 +18,6 @@ import { Link, ROUTES } from '../../components/primitives/Link'; import { Row } from '../../components/primitives/Row'; import { ComputedReserveData } from '../../hooks/app-data-provider/useAppDataProvider'; import { ListMobileItemWrapper } from '../dashboard/lists/ListMobileItemWrapper'; -import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; export const MarketAssetsListMobileItem = ({ ...reserve }: ComputedReserveData) => { const [trackEvent, currentMarket, selectedTimeRange] = useRootStore( diff --git a/src/modules/markets/index-current-query.ts b/src/modules/markets/index-current-query.ts index cac1d2f891..b193d156e5 100644 --- a/src/modules/markets/index-current-query.ts +++ b/src/modules/markets/index-current-query.ts @@ -1,4 +1,4 @@ -import { generateAliases } from "src/utils/generateSubgraphQueryAlias"; +import { generateAliases } from 'src/utils/generateSubgraphQueryAlias'; export const constructIndexCurrentQuery = (underlyingAssets: string[]): string => { const aliases = generateAliases(underlyingAssets.length); @@ -25,7 +25,7 @@ export const constructIndexCurrentQuery = (underlyingAssets: string[]): string = return ` query IndexCurrent { - ${queries.join("\n")} + ${queries.join('\n')} } `; }; diff --git a/src/modules/markets/index-history-query.ts b/src/modules/markets/index-history-query.ts index 469bae5535..dd1c0df77e 100644 --- a/src/modules/markets/index-history-query.ts +++ b/src/modules/markets/index-history-query.ts @@ -1,4 +1,4 @@ -import { generateAliases } from "src/utils/generateSubgraphQueryAlias"; +import { generateAliases } from 'src/utils/generateSubgraphQueryAlias'; export const constructIndexHistoryQuery = (underlyingAssets: string[]): string => { const aliases = generateAliases(underlyingAssets.length); @@ -25,7 +25,7 @@ export const constructIndexHistoryQuery = (underlyingAssets: string[]): string = return ` query IndexHistory($timestamp: Int!) { - ${queries.join("\n")} + ${queries.join('\n')} } `; }; diff --git a/src/store/protocolDataSlice.ts b/src/store/protocolDataSlice.ts index 26d85d52c0..cc0c59d601 100644 --- a/src/store/protocolDataSlice.ts +++ b/src/store/protocolDataSlice.ts @@ -1,4 +1,5 @@ import { providers, utils } from 'ethers'; +import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; import { permitByChainAndToken } from 'src/ui-config/permitConfig'; import { availableMarkets, @@ -12,7 +13,6 @@ import { CustomMarket, MarketDataType } from '../ui-config/marketsConfig'; import { NetworkConfig } from '../ui-config/networksConfig'; import { RootStore } from './root'; import { setQueryParameter } from './utils/queryParams'; -import { ESupportedAPYTimeRanges } from 'src/components/HistoricalAPYRow'; type TypePermitParams = { reserveAddress: string; @@ -47,7 +47,7 @@ export const createProtocolDataSlice: StateCreator< selectedTimeRange: ESupportedAPYTimeRanges.Now, jsonRpcProvider: (chainId) => getProvider(chainId ?? get().currentChainId), setSelectedTimeRange: (timeRange: ESupportedAPYTimeRanges) => { - set({ selectedTimeRange: timeRange }) + set({ selectedTimeRange: timeRange }); }, setCurrentMarket: (market, omitQueryParameterUpdate) => { if (!availableMarkets.includes(market as CustomMarket)) return;