From 3dcfdaf4e26d502410bfe5c88710970487062e2b Mon Sep 17 00:00:00 2001 From: Major <90963895+Majorfi@users.noreply.github.com> Date: Tue, 30 May 2023 18:02:06 +0200 Subject: [PATCH] lint: all \t to spaces for const, let and functions (#209) --- apps/common/components/AppHeader.tsx | 20 ++--- .../components/BalanceReminderPopover.tsx | 24 ++--- apps/common/components/HeroTimer.tsx | 2 +- apps/common/components/ImageWithFallback.tsx | 2 +- apps/common/components/ListHead.tsx | 6 +- apps/common/components/ListHero.tsx | 12 +-- apps/common/components/Meta.tsx | 2 +- apps/common/components/SearchBar.tsx | 2 +- apps/common/components/SettingsOverwrite.tsx | 16 ++-- apps/common/components/Switch.tsx | 6 +- apps/common/components/TokenDropdown.tsx | 2 +- apps/common/components/TokenIcon.tsx | 2 +- apps/common/components/ValueAnimation.tsx | 8 +- apps/common/contexts/useMenu.tsx | 10 +-- apps/common/contexts/useWallet.tsx | 34 +++---- apps/common/hooks/useBalance.tsx | 2 +- apps/common/hooks/useBalances.tsx | 64 ++++++------- apps/common/hooks/useFetch.ts | 4 +- apps/common/hooks/useTimer.tsx | 22 ++--- apps/common/hooks/useTokenPrice.tsx | 2 +- apps/common/icons/ArrowDown.tsx | 2 +- apps/common/icons/IconArrow.tsx | 2 +- apps/common/icons/IconArrowRight.tsx | 2 +- apps/common/icons/IconChevron.tsx | 2 +- apps/common/icons/IconChevronPlain.tsx | 2 +- apps/common/icons/LogoYearn.tsx | 2 +- apps/common/icons/LogoYearnBlue.tsx | 2 +- apps/common/icons/MessageIcon.tsx | 2 +- apps/common/utils/actions.tsx | 10 +-- apps/common/utils/index.tsx | 10 +-- apps/vaults/components/SettingsPopover.tsx | 2 +- .../details/VaultActionsTabsWrapper.tsx | 10 +-- .../details/actions/QuickActionsButtons.tsx | 6 +- .../details/actions/QuickActionsFrom.tsx | 4 +- .../details/actions/QuickActionsSwitch.tsx | 2 +- .../details/actions/QuickActionsTo.tsx | 4 +- .../details/tabs/VaultDetailsHistorical.tsx | 8 +- .../details/tabs/VaultDetailsStrategies.tsx | 10 +-- .../details/tabs/VaultDetailsTabsWrapper.tsx | 10 +-- .../graphs/GraphForStrategyReports.tsx | 14 +-- .../graphs/GraphForVaultEarnings.tsx | 8 +- .../graphs/GraphForVaultPPSGrowth.tsx | 4 +- .../components/graphs/GraphForVaultTVL.tsx | 8 +- .../components/list/VaultListFactory.tsx | 40 ++++----- .../components/list/VaultListOptions.tsx | 2 +- .../components/list/VaultsListEmpty.tsx | 2 +- .../list/VaultsListInternalMigrationRow.tsx | 2 +- .../components/list/VaultsListRetired.tsx | 2 +- apps/vaults/components/list/VaultsListRow.tsx | 2 +- apps/vaults/contexts/useActionFlow.tsx | 40 ++++----- apps/vaults/contexts/useAppSettings.tsx | 14 +-- apps/vaults/contexts/useStakingRewards.tsx | 2 +- apps/vaults/contexts/useWalletForZaps.tsx | 14 +-- apps/vaults/hooks/useAsync.ts | 6 +- apps/vaults/hooks/useFilteredVaults.ts | 2 +- apps/vaults/hooks/useFindVault.ts | 4 +- apps/vaults/hooks/useSolverChainCoin.ts | 4 +- apps/vaults/hooks/useSolverPartnerContract.ts | 4 +- apps/vaults/hooks/useSortVaults.ts | 28 +++--- .../hooks/useVaultEstimateOutFetcher.ts | 2 +- apps/vaults/utils/abi/vaultFactory.abi.ts | 2 +- apps/vaults/utils/abi/vaultMigrator.abi.ts | 2 +- apps/vaults/utils/zapOptions.tsx | 2 +- apps/veyfi/contexts/useVotingEscrow.tsx | 12 +-- .../components/bribe/GaugeBribeModal.tsx | 20 ++--- .../components/bribe/GaugeListEmpty.tsx | 8 +- apps/ybribe/components/bribe/GaugeListRow.tsx | 36 ++++---- .../components/claim/GaugeListEmpty.tsx | 14 +-- apps/ybribe/components/claim/GaugeListRow.tsx | 70 +++++++-------- .../rewardFeed/RewardFeedTableHead.tsx | 2 +- .../rewardFeed/RewardFeedTableRow.tsx | 26 +++--- apps/ybribe/contexts/useBribes.tsx | 90 +++++++++---------- apps/ybribe/utils/actions/addReward.tsx | 2 +- apps/ybribe/utils/actions/claimReward.tsx | 2 +- apps/ybribe/utils/index.tsx | 12 +-- apps/ycrv/components/CardMigrateLegacy.tsx | 24 ++--- .../ycrv/components/CardTransactorWrapper.tsx | 58 ++++++------ apps/ycrv/components/CardZap.tsx | 28 +++--- apps/ycrv/components/Harvests.tsx | 10 +-- apps/ycrv/components/HarvestsListHead.tsx | 2 +- apps/ycrv/components/HarvestsListRow.tsx | 2 +- apps/ycrv/components/QuickActions.tsx | 4 +- apps/ycrv/contexts/useYCRV.tsx | 74 +++++++-------- apps/ycrv/utils/actions.ts | 2 +- apps/ycrv/utils/zapOptions.tsx | 8 +- pages/_app.tsx | 16 ++-- pages/api/getBatchBalances.tsx | 10 +-- pages/index.tsx | 16 ++-- pages/vaults/[chainID]/[address].tsx | 6 +- pages/vaults/about.tsx | 4 +- pages/vaults/factory.tsx | 10 +-- pages/vaults/index.tsx | 74 +++++++-------- pages/ybribe/about.tsx | 2 +- pages/ybribe/index.tsx | 40 ++++----- pages/ybribe/offer-bribe.tsx | 44 ++++----- pages/ycrv/about.tsx | 6 +- pages/ycrv/holdings.tsx | 18 ++-- pages/ycrv/index.tsx | 12 +-- 98 files changed, 654 insertions(+), 654 deletions(-) diff --git a/apps/common/components/AppHeader.tsx b/apps/common/components/AppHeader.tsx index 22cf91c32..542ede8e1 100644 --- a/apps/common/components/AppHeader.tsx +++ b/apps/common/components/AppHeader.tsx @@ -21,8 +21,8 @@ import {MotionDiv} from './MotionDiv'; import type {ReactElement} from 'react'; import type {TMenu} from '@yearn-finance/web-lib/components/Header'; -function Logo(): ReactElement { - const {pathname} = useRouter(); +function Logo(): ReactElement { + const {pathname} = useRouter(); return ( <> @@ -41,7 +41,7 @@ function Logo(): ReactElement { } -function LogoPopover(): ReactElement { +function LogoPopover(): ReactElement { const [isShowing, set_isShowing] = useState(false); return ( @@ -95,12 +95,12 @@ function LogoPopover(): ReactElement { ); } -export function AppHeader(): ReactElement { - const isMounted = useIsMounted(); - const {pathname} = useRouter(); - const {isActive} = useWeb3(); - const {onOpenMenu} = useMenu(); - const menu = useMemo((): TMenu[] => { +export function AppHeader(): ReactElement { + const isMounted = useIsMounted(); + const {pathname} = useRouter(); + const {isActive} = useWeb3(); + const {onOpenMenu} = useMenu(); + const menu = useMemo((): TMenu[] => { const HOME_MENU = {path: '/', label: 'Home'}; if (pathname.startsWith('/ycrv')) { @@ -126,7 +126,7 @@ export function AppHeader(): ReactElement { ]; }, [pathname]); - const supportedNetworks = useMemo((): number[] => { + const supportedNetworks = useMemo((): number[] => { if (pathname.startsWith('/ycrv') || pathname.startsWith('/veyfi') || pathname.startsWith('/ybribe')) { return [1]; } diff --git a/apps/common/components/BalanceReminderPopover.tsx b/apps/common/components/BalanceReminderPopover.tsx index 54db984d8..2888aa27a 100755 --- a/apps/common/components/BalanceReminderPopover.tsx +++ b/apps/common/components/BalanceReminderPopover.tsx @@ -25,10 +25,10 @@ type TBalanceReminderElement = { symbol: string, } -function TokenItem({element}: {element: TBalanceReminderElement}): ReactElement { - const {provider} = useWeb3(); - const {safeChainID} = useChainID(); - const balance = useBalance(element.address); +function TokenItem({element}: {element: TBalanceReminderElement}): ReactElement { + const {provider} = useWeb3(); + const {safeChainID} = useChainID(); + const balance = useBalance(element.address); async function addTokenToMetamask(address: string, symbol: string, decimals: number, image: string): Promise { if (!provider) { @@ -91,12 +91,12 @@ function TokenItem({element}: {element: TBalanceReminderElement}): ReactElement } export default function BalanceReminderPopover(): ReactElement { - const {balances, isLoading} = useWallet(); - const {address, ens, isActive, onDesactivate} = useWeb3(); - const {vaults} = useYearn(); + const {balances, isLoading} = useWallet(); + const {address, ens, isActive, onDesactivate} = useWeb3(); + const {vaults} = useYearn(); - const nonNullBalances = useMemo((): TDict => { - const nonNullBalances = Object.entries(balances).reduce((acc: TDict, [address, balance]): TDict => { + const nonNullBalances = useMemo((): TDict => { + const nonNullBalances = Object.entries(balances).reduce((acc: TDict, [address, balance]): TDict => { if (toBigInt(balance?.raw) > 0n) { acc[toAddress(address)] = balance; } @@ -105,8 +105,8 @@ export default function BalanceReminderPopover(): ReactElement { return nonNullBalances; }, [balances]); - const nonNullBalancesForVault = useMemo((): TBalanceReminderElement[] => { - const nonNullBalancesForVault = Object.entries(nonNullBalances).reduce((acc: TBalanceReminderElement[], [address, balance]): TBalanceReminderElement[] => { + const nonNullBalancesForVault = useMemo((): TBalanceReminderElement[] => { + const nonNullBalancesForVault = Object.entries(nonNullBalances).reduce((acc: TBalanceReminderElement[], [address, balance]): TBalanceReminderElement[] => { const currentVault = vaults?.[toAddress(address)]; if (currentVault) { acc.push({ @@ -121,7 +121,7 @@ export default function BalanceReminderPopover(): ReactElement { return nonNullBalancesForVault; }, [nonNullBalances, vaults]); - function renderNoTokenFallback(isLoading: boolean): ReactElement { + function renderNoTokenFallback(isLoading: boolean): ReactElement { if (isLoading) { return (
diff --git a/apps/common/components/HeroTimer.tsx b/apps/common/components/HeroTimer.tsx index 1e0f0347e..1d1755ae8 100755 --- a/apps/common/components/HeroTimer.tsx +++ b/apps/common/components/HeroTimer.tsx @@ -12,7 +12,7 @@ type TProps = { endTime?: TSeconds; } -function HeroTimer({endTime}: TProps): ReactElement { +function HeroTimer({endTime}: TProps): ReactElement { const time = useTimer({endTime}); return ( diff --git a/apps/common/components/ImageWithFallback.tsx b/apps/common/components/ImageWithFallback.tsx index b92cbc3ff..7fea86ea0 100755 --- a/apps/common/components/ImageWithFallback.tsx +++ b/apps/common/components/ImageWithFallback.tsx @@ -7,7 +7,7 @@ import type {ReactElement} from 'react'; export type TImageWithFallbackProps = ImageProps & { onCatchError?: () => void; }; -function ImageWithFallback(props: TImageWithFallbackProps): ReactElement { +function ImageWithFallback(props: TImageWithFallbackProps): ReactElement { const {alt, src, onCatchError, ...rest} = props; const [imageSrc, set_imageSrc] = useState(src); diff --git a/apps/common/components/ListHead.tsx b/apps/common/components/ListHead.tsx index 865c507d5..94e8671f9 100644 --- a/apps/common/components/ListHead.tsx +++ b/apps/common/components/ListHead.tsx @@ -17,14 +17,14 @@ export type TListHead = { onSort: (sortBy: string, sortDirection: TSortDirection) => void } -function ListHead({items, dataClassName, sortBy, sortDirection, onSort}: TListHead): ReactElement { +function ListHead({items, dataClassName, sortBy, sortDirection, onSort}: TListHead): ReactElement { const toggleSortDirection = (newSortBy: string): TSortDirection => { return sortBy === newSortBy ? ( sortDirection === '' ? 'desc' : sortDirection === 'desc' ? 'asc' : 'desc' ) : 'desc'; }; - const renderChevron = useCallback((shouldSortBy: boolean): ReactElement => { + const renderChevron = useCallback((shouldSortBy: boolean): ReactElement => { if (shouldSortBy && sortDirection === 'desc') { return ; } @@ -34,7 +34,7 @@ function ListHead({items, dataClassName, sortBy, sortDirection, onSort}: TListHe return ; }, [sortDirection]); - const [first, ...rest] = items; + const [first, ...rest] = items; return (
diff --git a/apps/common/components/ListHero.tsx b/apps/common/components/ListHero.tsx index 04c46bc5e..51adf892f 100644 --- a/apps/common/components/ListHero.tsx +++ b/apps/common/components/ListHero.tsx @@ -34,8 +34,8 @@ export type TListHeroDesktopCategories = { onSelect: (category: T) => void; } -function DesktopCategories({categories, onSelect}: TListHeroDesktopCategories): ReactElement { - const [isClientLoaded, set_isClientLoaded] = useState(false); +function DesktopCategories({categories, onSelect}: TListHeroDesktopCategories): ReactElement { + const [isClientLoaded, set_isClientLoaded] = useState(false); useEffect((): void => { set_isClientLoaded(true); }, []); @@ -66,10 +66,10 @@ function DesktopCategories({categories, onSelect}: TListHeroDesktopCategories } function Switch(props: TSwitchProps): ReactElement { - const {isEnabled, onSwitch} = props; - const [isEnabledState, set_isEnabledState] = useState(isEnabled); + const {isEnabled, onSwitch} = props; + const [isEnabledState, set_isEnabledState] = useState(isEnabled); - function safeOnSwitch(): void { + function safeOnSwitch(): void { if (onSwitch) { onSwitch(!isEnabled); } else { @@ -93,7 +93,7 @@ function Switch(props: TSwitchProps): ReactElement { ); } -function ListHero({ +function ListHero({ headLabel, searchLabel, searchPlaceholder, diff --git a/apps/common/components/Meta.tsx b/apps/common/components/Meta.tsx index cd5462255..e1bd981bd 100755 --- a/apps/common/components/Meta.tsx +++ b/apps/common/components/Meta.tsx @@ -28,7 +28,7 @@ export type TMetaFile = { orientation: string; } -function Meta({meta}: {meta: TMetaFile}): ReactElement { +function Meta({meta}: {meta: TMetaFile}): ReactElement { return ( <> diff --git a/apps/common/components/SearchBar.tsx b/apps/common/components/SearchBar.tsx index 6b8511b76..d5f6aebfb 100644 --- a/apps/common/components/SearchBar.tsx +++ b/apps/common/components/SearchBar.tsx @@ -7,7 +7,7 @@ export type TSearchBar = { set_searchValue: (searchValue: string) => void; } -export function SearchBar({searchLabel, searchPlaceholder, searchValue, set_searchValue}: TSearchBar): ReactElement { +export function SearchBar({searchLabel, searchPlaceholder, searchValue, set_searchValue}: TSearchBar): ReactElement { return (