From adcc092083a1e4a3119d08a53b513952e7f6f422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ribeiro?= Date: Sat, 9 Nov 2024 12:40:22 -0300 Subject: [PATCH] chore: fix biome issues --- apps/claim-vesting/src/app/page.tsx | 2 +- .../claim-vesting/src/hooks/useClaimVestingData.ts | 6 +++--- apps/create-vesting/src/context/form.tsx | 6 +++--- .../create-vesting/src/hooks/useFormatVariables.ts | 14 +++++++------- apps/deposit-pool/src/components/PoolForm.tsx | 10 +++++----- apps/deposit-pool/src/components/PoolItemInfo.tsx | 2 +- .../src/components/TokenAmountInput.tsx | 14 +++++++------- apps/deposit-pool/src/contexts/form.tsx | 6 +++--- apps/deposit-pool/src/utils/formatTokenBalance.ts | 6 +++--- apps/withdraw-pool/src/components/PoolItemInfo.tsx | 2 +- apps/withdraw-pool/src/components/SubmitButton.tsx | 2 +- .../src/components/WithdrawPctSlider.tsx | 4 ++-- apps/withdraw-pool/src/context/form.tsx | 6 +++--- packages/cow-hooks-ui/src/ButtonPrimary.tsx | 2 +- packages/cow-hooks-ui/src/PoolsDropdownMenu.tsx | 4 ++-- packages/cow-hooks-ui/src/TokenLogoWithWeight.tsx | 2 +- packages/cow-hooks-ui/src/ui/Command.tsx | 10 +++++----- packages/cow-hooks-ui/src/ui/InputBase.tsx | 4 ++-- .../cow-hooks-ui/src/ui/PeriodWithScaleInput.tsx | 2 +- packages/cow-hooks-ui/src/ui/Table.tsx | 6 +++--- packages/cow-hooks-ui/src/ui/TokenAmountInput.tsx | 2 +- 21 files changed, 56 insertions(+), 56 deletions(-) diff --git a/apps/claim-vesting/src/app/page.tsx b/apps/claim-vesting/src/app/page.tsx index 3af5fb0..2237023 100644 --- a/apps/claim-vesting/src/app/page.tsx +++ b/apps/claim-vesting/src/app/page.tsx @@ -28,7 +28,7 @@ export default function Page() { const { account, chainId } = context || {}; const [typedAddress, setTypedAddress] = useState( - context?.hookToEdit?.hook.target || "" + context?.hookToEdit?.hook.target || "", ); const [debouncedAddress] = useDebounceValue(typedAddress, 300, { diff --git a/apps/claim-vesting/src/hooks/useClaimVestingData.ts b/apps/claim-vesting/src/hooks/useClaimVestingData.ts index f09f39b..bbb256d 100644 --- a/apps/claim-vesting/src/hooks/useClaimVestingData.ts +++ b/apps/claim-vesting/src/hooks/useClaimVestingData.ts @@ -43,7 +43,7 @@ export const useClaimVestingData = ({ chain: chainMapping[chainId], transport: http(), }), - [chainId] + [chainId], ); const { claimableAmountWei, @@ -96,7 +96,7 @@ export const useClaimVestingData = ({ 6, "decimal", "standard", - 0.000001 + 0.000001, ) : "0.0"; const formattedClaimableAmountFullDecimals = @@ -106,7 +106,7 @@ export const useClaimVestingData = ({ Number(decimals), "decimal", "standard", - Number(`0.${"0".repeat(Number(decimals) - 1)}1`) + Number(`0.${"0".repeat(Number(decimals) - 1)}1`), ) : "0.0"; const loading = isLoadingToken || isLoadingVesting || isLoadingGasLimit; diff --git a/apps/create-vesting/src/context/form.tsx b/apps/create-vesting/src/context/form.tsx index 7fff07a..c934712 100644 --- a/apps/create-vesting/src/context/form.tsx +++ b/apps/create-vesting/src/context/form.tsx @@ -2,8 +2,8 @@ import { type PropsWithChildren, useCallback, useMemo } from "react"; -import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { Form } from "@bleu.builders/ui"; +import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { zodResolver } from "@hookform/resolvers/zod"; import { useRouter } from "next/navigation"; import { useForm } from "react-hook-form"; @@ -95,12 +95,12 @@ export function FormContextProvider({ children }: PropsWithChildren) { getHooksTransactions, setError, clearErrors, - ] + ], ); const onSubmit = useMemo( () => form.handleSubmit(onSubmitCallback), - [form, onSubmitCallback] + [form, onSubmitCallback], ); return ( diff --git a/apps/create-vesting/src/hooks/useFormatVariables.ts b/apps/create-vesting/src/hooks/useFormatVariables.ts index 35121a2..d6cd2b4 100644 --- a/apps/create-vesting/src/hooks/useFormatVariables.ts +++ b/apps/create-vesting/src/hooks/useFormatVariables.ts @@ -1,5 +1,5 @@ -import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { formatNumber } from "@bleu.builders/ui"; +import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { useMemo } from "react"; export const useFormatVariables = ({ @@ -16,7 +16,7 @@ export const useFormatVariables = ({ userBalance !== undefined && tokenDecimals ? Number(userBalance) / 10 ** Number(tokenDecimals) : undefined, - [userBalance, tokenDecimals] + [userBalance, tokenDecimals], ); const swapAmountFloat = useMemo( @@ -24,7 +24,7 @@ export const useFormatVariables = ({ context?.orderParams?.buyAmount !== undefined && tokenDecimals ? Number(context?.orderParams?.buyAmount) / 10 ** Number(tokenDecimals) : undefined, - [context?.orderParams?.buyAmount, tokenDecimals] + [context?.orderParams?.buyAmount, tokenDecimals], ); const allAfterSwapFloat = useMemo( @@ -32,7 +32,7 @@ export const useFormatVariables = ({ userBalanceFloat !== undefined && swapAmountFloat !== undefined ? userBalanceFloat + swapAmountFloat : undefined, - [userBalanceFloat, swapAmountFloat] + [userBalanceFloat, swapAmountFloat], ); const formattedUserBalance = useMemo( @@ -40,7 +40,7 @@ export const useFormatVariables = ({ userBalanceFloat !== undefined ? formatNumber(userBalanceFloat, 4, "decimal", "standard", 0.0001) : "", - [userBalanceFloat] + [userBalanceFloat], ); const formattedSwapAmount = useMemo( @@ -48,7 +48,7 @@ export const useFormatVariables = ({ swapAmountFloat !== undefined ? formatNumber(swapAmountFloat, 4, "decimal", "standard", 0.0001) : "", - [swapAmountFloat] + [swapAmountFloat], ); const formattedAllAfterSwap = useMemo( @@ -56,7 +56,7 @@ export const useFormatVariables = ({ allAfterSwapFloat !== undefined ? formatNumber(allAfterSwapFloat, 6, "decimal", "standard", 0.000001) : "", - [allAfterSwapFloat] + [allAfterSwapFloat], ); return { diff --git a/apps/deposit-pool/src/components/PoolForm.tsx b/apps/deposit-pool/src/components/PoolForm.tsx index 38abd3b..760e8f2 100644 --- a/apps/deposit-pool/src/components/PoolForm.tsx +++ b/apps/deposit-pool/src/components/PoolForm.tsx @@ -1,10 +1,10 @@ +import { Label, formatNumber } from "@bleu.builders/ui"; import { type IPool, Info, Spinner, useIFrameContext, } from "@bleu/cow-hooks-ui"; -import { Label, formatNumber } from "@bleu.builders/ui"; import { useCallback, useEffect, useMemo } from "react"; import { useFormContext, useWatch } from "react-hook-form"; import { type Address, formatUnits } from "viem"; @@ -27,7 +27,7 @@ export function PoolForm({ pool }: { pool: IPool | undefined }) { const { buyAmount } = useSwapAmount(); const buyAmountAfterSwap = useTokenBalanceAfterSwap( - context?.orderParams?.buyTokenAddress as Address + context?.orderParams?.buyTokenAddress as Address, ); const { data: poolBalances, isLoading: isBalanceLoading } = usePoolBalance({ @@ -51,7 +51,7 @@ export function PoolForm({ pool }: { pool: IPool | undefined }) { const tokenPrices = useMemo( () => poolBalances?.map((poolBalance) => getTokenPrice(poolBalance)), - [poolBalances] + [poolBalances], ); const totalUsd = useMemo(() => { @@ -87,14 +87,14 @@ export function PoolForm({ pool }: { pool: IPool | undefined }) { const tokenAmountKey = `amounts.${tokenAmountAddress}` as const; const calculatedAmount = formatUnits( tokenAmount.rawAmount, - tokenAmount.decimals + tokenAmount.decimals, ); setValue(tokenAmountKey, calculatedAmount); } setValue("referenceTokenAddress", address); }, - [poolBalances, tokenPrices, pool, setValue] + [poolBalances, tokenPrices, pool, setValue], ); useEffect(() => { diff --git a/apps/deposit-pool/src/components/PoolItemInfo.tsx b/apps/deposit-pool/src/components/PoolItemInfo.tsx index 076f1e1..27f6a98 100644 --- a/apps/deposit-pool/src/components/PoolItemInfo.tsx +++ b/apps/deposit-pool/src/components/PoolItemInfo.tsx @@ -1,5 +1,5 @@ -import type { IPool } from "@bleu/cow-hooks-ui"; import { formatNumber } from "@bleu.builders/ui"; +import type { IPool } from "@bleu/cow-hooks-ui"; export function PoolItemInfo({ pool }: { pool: IPool }) { const aprSumPct = diff --git a/apps/deposit-pool/src/components/TokenAmountInput.tsx b/apps/deposit-pool/src/components/TokenAmountInput.tsx index 4917349..4b93e49 100644 --- a/apps/deposit-pool/src/components/TokenAmountInput.tsx +++ b/apps/deposit-pool/src/components/TokenAmountInput.tsx @@ -1,5 +1,5 @@ -import { type IBalance, TokenLogoWithWeight } from "@bleu/cow-hooks-ui"; import { Button, Input, formatNumber } from "@bleu.builders/ui"; +import { type IBalance, TokenLogoWithWeight } from "@bleu/cow-hooks-ui"; import { useCallback, useMemo } from "react"; import { useFormContext, useWatch } from "react-hook-form"; import type { Address } from "viem"; @@ -32,7 +32,7 @@ export function TokenAmountInput({ }); const tokenBalanceAfterSwap = useTokenBalanceAfterSwap( - poolBalance.token.address + poolBalance.token.address, ); const amountUsd = useMemo(() => { @@ -46,11 +46,11 @@ export function TokenAmountInput({ if (updateTokenAmounts) { updateTokenAmounts( constraintStringToBeNumeric(amount), - poolBalance.token.address as Address + poolBalance.token.address as Address, ); } }, - [updateTokenAmounts, poolBalance.token.address] + [updateTokenAmounts, poolBalance.token.address], ); const disabled = amountFromSwap || amountFromAccount; @@ -82,7 +82,7 @@ export function TokenAmountInput({ onChange(e.target.value); setValue( `amounts.${poolBalance.token.address.toLowerCase()}`, - constraintStringToBeNumeric(e.target.value) + constraintStringToBeNumeric(e.target.value), ); }, })} @@ -104,7 +104,7 @@ export function TokenAmountInput({ 4, "decimal", "standard", - 0.0001 + 0.0001, )} {!buttonDisabled && ( @@ -115,7 +115,7 @@ export function TokenAmountInput({ onClick={() => { setValue( `amounts.${poolBalance.token.address.toLowerCase()}`, - tokenBalanceAfterSwap + tokenBalanceAfterSwap, ); onChange(tokenBalanceAfterSwap); }} diff --git a/apps/deposit-pool/src/contexts/form.tsx b/apps/deposit-pool/src/contexts/form.tsx index c804a78..990bd19 100644 --- a/apps/deposit-pool/src/contexts/form.tsx +++ b/apps/deposit-pool/src/contexts/form.tsx @@ -2,8 +2,8 @@ import { type PropsWithChildren, useCallback, useMemo } from "react"; -import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { Form } from "@bleu.builders/ui"; +import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { useRouter } from "next/navigation"; import { useForm, useWatch } from "react-hook-form"; import { useGetHookInfo } from "#/hooks/useGetHookInfo"; @@ -27,7 +27,7 @@ export function FormContextProvider({ children }: PropsWithChildren) { const selectedPool = useMemo( () => pools?.find((pool) => pool.id === poolId), - [pools, poolId] + [pools, poolId], ); const getHookInfo = useGetHookInfo(selectedPool); @@ -39,7 +39,7 @@ export function FormContextProvider({ children }: PropsWithChildren) { setHookInfo(hookInfo); router.push("/signing"); }, - [getHookInfo, setHookInfo, router] + [getHookInfo, setHookInfo, router], ); return ( diff --git a/apps/deposit-pool/src/utils/formatTokenBalance.ts b/apps/deposit-pool/src/utils/formatTokenBalance.ts index ad5092a..9606974 100644 --- a/apps/deposit-pool/src/utils/formatTokenBalance.ts +++ b/apps/deposit-pool/src/utils/formatTokenBalance.ts @@ -3,7 +3,7 @@ import { formatNumber } from "@bleu.builders/ui"; export const formatTokenBalance = ( balance: bigint, tokenDecimals: number, - swapAmount: string | null + swapAmount: string | null, ) => { const balanceNowFloat = Number(balance) / 10 ** tokenDecimals; const swapAmountFloat = @@ -15,7 +15,7 @@ export const formatTokenBalance = ( 4, "decimal", "standard", - 0.0001 + 0.0001, ); const balanceAfterSwapFormatted = formatNumber( @@ -23,7 +23,7 @@ export const formatTokenBalance = ( 4, "decimal", "standard", - 0.0001 + 0.0001, ); return { diff --git a/apps/withdraw-pool/src/components/PoolItemInfo.tsx b/apps/withdraw-pool/src/components/PoolItemInfo.tsx index 388e5bb..7c1730b 100644 --- a/apps/withdraw-pool/src/components/PoolItemInfo.tsx +++ b/apps/withdraw-pool/src/components/PoolItemInfo.tsx @@ -1,5 +1,5 @@ -import type { IPool } from "@bleu/cow-hooks-ui"; import { formatNumber } from "@bleu.builders/ui"; +import type { IPool } from "@bleu/cow-hooks-ui"; export function PoolItemInfo({ pool }: { pool: IPool }) { return ${formatNumber(pool.userBalance.walletBalanceUsd, 2)}; diff --git a/apps/withdraw-pool/src/components/SubmitButton.tsx b/apps/withdraw-pool/src/components/SubmitButton.tsx index 98aabec..c25025a 100644 --- a/apps/withdraw-pool/src/components/SubmitButton.tsx +++ b/apps/withdraw-pool/src/components/SubmitButton.tsx @@ -1,5 +1,5 @@ -import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { Button } from "@bleu.builders/ui"; +import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { useMemo } from "react"; import { useFormContext, useFormState, useWatch } from "react-hook-form"; diff --git a/apps/withdraw-pool/src/components/WithdrawPctSlider.tsx b/apps/withdraw-pool/src/components/WithdrawPctSlider.tsx index b91d9ef..30d1d95 100644 --- a/apps/withdraw-pool/src/components/WithdrawPctSlider.tsx +++ b/apps/withdraw-pool/src/components/WithdrawPctSlider.tsx @@ -1,7 +1,7 @@ "use client"; -import { Input } from "@bleu/cow-hooks-ui"; import { Button, Label, cn } from "@bleu.builders/ui"; +import { Input } from "@bleu/cow-hooks-ui"; import { useFormContext, useWatch } from "react-hook-form"; import type { withdrawSchema } from "#/utils/schema"; @@ -23,7 +23,7 @@ export function WithdrawPctSlider() { variant="ghost" className={cn( "rounded-2xl text-xs py-1 bg-accent text-accent-foreground opacity-50 hover:opacity-100 h-fit", - withdrawPct.toString() === pct.toString() ? "opacity-100" : "" + withdrawPct.toString() === pct.toString() ? "opacity-100" : "", )} onClick={() => setValue("withdrawPct", pct)} > diff --git a/apps/withdraw-pool/src/context/form.tsx b/apps/withdraw-pool/src/context/form.tsx index 3440018..423cf9a 100644 --- a/apps/withdraw-pool/src/context/form.tsx +++ b/apps/withdraw-pool/src/context/form.tsx @@ -2,8 +2,8 @@ import { type PropsWithChildren, useCallback, useEffect, useMemo } from "react"; -import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { Form } from "@bleu.builders/ui"; +import { useIFrameContext } from "@bleu/cow-hooks-ui"; import { zodResolver } from "@hookform/resolvers/zod"; import { useRouter } from "next/navigation"; import { useForm, useWatch } from "react-hook-form"; @@ -32,7 +32,7 @@ export function FormContextProvider({ children }: PropsWithChildren) { const selectedPool = useMemo(() => { return pools?.find( - (pool) => pool.id.toLowerCase() === poolId?.toLowerCase() + (pool) => pool.id.toLowerCase() === poolId?.toLowerCase(), ); }, [pools, poolId]); @@ -47,7 +47,7 @@ export function FormContextProvider({ children }: PropsWithChildren) { setHookInfo(hookInfo); router.push("/signing"); }, - [getHooksTransactions, setHookInfo, router] + [getHooksTransactions, setHookInfo, router], ); // biome-ignore lint: diff --git a/packages/cow-hooks-ui/src/ButtonPrimary.tsx b/packages/cow-hooks-ui/src/ButtonPrimary.tsx index b033402..518d290 100644 --- a/packages/cow-hooks-ui/src/ButtonPrimary.tsx +++ b/packages/cow-hooks-ui/src/ButtonPrimary.tsx @@ -7,7 +7,7 @@ export const ButtonPrimary: React.FC<