From 2cdb45088f230e3e0c5f504b23ee2030c9dbfdda Mon Sep 17 00:00:00 2001 From: ioay Date: Thu, 11 Jan 2024 14:28:14 +0100 Subject: [PATCH] Update imports --- dapp/package.json | 1 - dapp/src/components/DocsDrawer/index.tsx | 4 +- dapp/src/components/GlobalStyles/index.tsx | 10 +-- dapp/src/components/Header/ConnectWallet.tsx | 10 +-- dapp/src/components/Header/index.tsx | 2 +- .../components/Modals/ActionForm/index.tsx | 2 +- .../components/Modals/Staking/DepositBTC.tsx | 6 +- .../Modals/Staking/Overview/index.tsx | 4 +- .../Modals/Staking/Overview/steps.tsx | 2 +- .../components/Modals/Staking/SignMessage.tsx | 6 +- .../Modals/Staking/StakeForm/Details.tsx | 8 +-- .../Modals/Staking/StakeForm/index.tsx | 10 +-- .../Staking/components/StakingSteps.tsx | 6 +- dapp/src/components/Modals/Staking/index.tsx | 4 +- .../Modals/Support/MissingAccount.tsx | 8 +-- dapp/src/components/Modals/Support/index.tsx | 4 +- .../components/Overview/PositionDetails.tsx | 6 +- dapp/src/components/Overview/Statistics.tsx | 2 +- .../Overview/TransactionHistory.tsx | 2 +- dapp/src/components/Overview/index.tsx | 8 +-- dapp/src/components/Sidebar/index.tsx | 2 +- dapp/src/components/shared/Alert/index.tsx | 2 +- .../shared/CurrencyBalance/index.tsx | 4 +- .../src/components/shared/ModalBase/index.tsx | 4 +- .../TokenAmountForm/TokenAmountFormBase.tsx | 2 +- .../shared/TokenAmountForm/index.tsx | 2 +- .../shared/TokenBalanceInput/index.tsx | 6 +- dapp/src/constants/currency.ts | 2 +- dapp/src/contexts/TransactionContext.tsx | 2 +- dapp/src/hooks/useDepositBTCTransaction.ts | 2 +- dapp/src/hooks/useDocsDrawer.ts | 2 +- dapp/src/hooks/useModalFlowContext.ts | 2 +- dapp/src/hooks/useRequestBitcoinAccount.ts | 6 +- dapp/src/hooks/useRequestEthereumAccount.ts | 6 +- dapp/src/hooks/useSidebar.ts | 2 +- dapp/src/hooks/useSignMessage.ts | 2 +- dapp/src/hooks/useTransactionContext.ts | 2 +- dapp/src/hooks/useWalletContext.ts | 2 +- dapp/src/utils/currency.ts | 4 +- dapp/src/utils/forms.ts | 2 +- dapp/vite.config.ts | 3 +- pnpm-lock.yaml | 63 +++++++------------ 42 files changed, 103 insertions(+), 126 deletions(-) diff --git a/dapp/package.json b/dapp/package.json index 439201a1c..9abe245b2 100644 --- a/dapp/package.json +++ b/dapp/package.json @@ -39,7 +39,6 @@ "prettier": "^3.1.0", "typescript": "^5.3.2", "vite": "^5.0.2", - "vite-plugin-eslint": "^1.8.1", "vite-plugin-node-polyfills": "^0.19.0", "vite-tsconfig-paths": "^4.2.3" } diff --git a/dapp/src/components/DocsDrawer/index.tsx b/dapp/src/components/DocsDrawer/index.tsx index 5082af57b..35e49647c 100644 --- a/dapp/src/components/DocsDrawer/index.tsx +++ b/dapp/src/components/DocsDrawer/index.tsx @@ -5,8 +5,8 @@ import { DrawerContent, DrawerOverlay, } from "@chakra-ui/react" -import { useDocsDrawer } from "../../hooks" -import { TextMd } from "../shared/Typography" +import { useDocsDrawer } from "~/hooks" +import { TextMd } from "~/components/shared/Typography" export default function DocsDrawer() { const { isOpen, onClose } = useDocsDrawer() diff --git a/dapp/src/components/GlobalStyles/index.tsx b/dapp/src/components/GlobalStyles/index.tsx index 80b36e6e8..d316cead6 100644 --- a/dapp/src/components/GlobalStyles/index.tsx +++ b/dapp/src/components/GlobalStyles/index.tsx @@ -1,11 +1,11 @@ import React from "react" import { Global } from "@emotion/react" -import SegmentRegular from "../../fonts/Segment-Regular.otf" -import SegmentMedium from "../../fonts/Segment-Medium.otf" -import SegmentSemiBold from "../../fonts/Segment-SemiBold.otf" -import SegmentBold from "../../fonts/Segment-Bold.otf" -import SegmentBlack from "../../fonts/Segment-Black.otf" +import SegmentRegular from "~/fonts/Segment-Regular.otf" +import SegmentMedium from "~/fonts/Segment-Medium.otf" +import SegmentSemiBold from "~/fonts/Segment-SemiBold.otf" +import SegmentBold from "~/fonts/Segment-Bold.otf" +import SegmentBlack from "~/fonts/Segment-Black.otf" export default function GlobalStyles() { return ( diff --git a/dapp/src/components/Header/ConnectWallet.tsx b/dapp/src/components/Header/ConnectWallet.tsx index 90069b4e7..28bad070d 100644 --- a/dapp/src/components/Header/ConnectWallet.tsx +++ b/dapp/src/components/Header/ConnectWallet.tsx @@ -1,15 +1,15 @@ import React from "react" import { Button, HStack, Icon } from "@chakra-ui/react" import { Account } from "@ledgerhq/wallet-api-client" -import { Bitcoin, Ethereum } from "../../static/icons" import { useRequestBitcoinAccount, useRequestEthereumAccount, useWalletContext, -} from "../../hooks" -import { truncateAddress } from "../../utils" -import { CurrencyBalance } from "../shared/CurrencyBalance" -import { TextMd } from "../shared/Typography" +} from "~/hooks" +import { CurrencyBalance } from "~/components/shared/CurrencyBalance" +import { TextMd } from "~/components/shared/Typography" +import { Bitcoin, Ethereum } from "~/static/icons" +import { truncateAddress } from "~/utils" export type ConnectButtonsProps = { leftIcon: typeof Icon diff --git a/dapp/src/components/Header/index.tsx b/dapp/src/components/Header/index.tsx index 544fbdee9..b0d47f2ab 100644 --- a/dapp/src/components/Header/index.tsx +++ b/dapp/src/components/Header/index.tsx @@ -1,7 +1,7 @@ import React from "react" import { Flex, HStack, Icon } from "@chakra-ui/react" +import { AcreLogo } from "~/static/icons" import ConnectWallet from "./ConnectWallet" -import { AcreLogo } from "../../static/icons" export default function Header() { return ( diff --git a/dapp/src/components/Modals/ActionForm/index.tsx b/dapp/src/components/Modals/ActionForm/index.tsx index 0eae3fe5b..d6a595d5d 100644 --- a/dapp/src/components/Modals/ActionForm/index.tsx +++ b/dapp/src/components/Modals/ActionForm/index.tsx @@ -7,8 +7,8 @@ import { TabPanels, TabPanel, } from "@chakra-ui/react" +import { useModalFlowContext } from "~/hooks" import StakeForm from "../Staking/StakeForm" -import { useModalFlowContext } from "../../../hooks" const TABS = ["stake", "unstake"] as const diff --git a/dapp/src/components/Modals/Staking/DepositBTC.tsx b/dapp/src/components/Modals/Staking/DepositBTC.tsx index 853159262..20e649956 100644 --- a/dapp/src/components/Modals/Staking/DepositBTC.tsx +++ b/dapp/src/components/Modals/Staking/DepositBTC.tsx @@ -1,7 +1,7 @@ import React from "react" -import Alert from "../../shared/Alert" -import { useDepositBTCTransaction, useModalFlowContext } from "../../../hooks" -import { TextMd } from "../../shared/Typography" +import { useDepositBTCTransaction, useModalFlowContext } from "~/hooks" +import Alert from "~/components/shared/Alert" +import { TextMd } from "~/components/shared/Typography" import StakingSteps from "./components/StakingSteps" export default function DepositBTC() { diff --git a/dapp/src/components/Modals/Staking/Overview/index.tsx b/dapp/src/components/Modals/Staking/Overview/index.tsx index ecb2c310a..330bb7289 100644 --- a/dapp/src/components/Modals/Staking/Overview/index.tsx +++ b/dapp/src/components/Modals/Staking/Overview/index.tsx @@ -6,8 +6,8 @@ import { ModalHeader, StepNumber, } from "@chakra-ui/react" -import { useModalFlowContext } from "../../../../hooks" -import StepperBase from "../../../shared/StepperBase" +import StepperBase from "~/components/shared/StepperBase" +import { useModalFlowContext } from "~/hooks" import { STEPS } from "./steps" export default function Overview() { diff --git a/dapp/src/components/Modals/Staking/Overview/steps.tsx b/dapp/src/components/Modals/Staking/Overview/steps.tsx index 257c671fa..532e35e50 100644 --- a/dapp/src/components/Modals/Staking/Overview/steps.tsx +++ b/dapp/src/components/Modals/Staking/Overview/steps.tsx @@ -1,5 +1,5 @@ import React from "react" -import { StepBase } from "../../../shared/StepperBase" +import { StepBase } from "~/components/shared/StepperBase" import { Description, Title } from "../components/StakingSteps" export const STEPS: StepBase[] = [ diff --git a/dapp/src/components/Modals/Staking/SignMessage.tsx b/dapp/src/components/Modals/Staking/SignMessage.tsx index 3c6442676..dfe7d2dc1 100644 --- a/dapp/src/components/Modals/Staking/SignMessage.tsx +++ b/dapp/src/components/Modals/Staking/SignMessage.tsx @@ -1,8 +1,8 @@ import React from "react" import { Highlight } from "@chakra-ui/react" -import Alert from "../../shared/Alert" -import { useModalFlowContext, useSignMessage } from "../../../hooks" -import { TextMd } from "../../shared/Typography" +import { useModalFlowContext, useSignMessage } from "~/hooks" +import Alert from "~/components/shared/Alert" +import { TextMd } from "~/components/shared/Typography" import StakingSteps from "./components/StakingSteps" export default function SignMessage() { diff --git a/dapp/src/components/Modals/Staking/StakeForm/Details.tsx b/dapp/src/components/Modals/Staking/StakeForm/Details.tsx index efa0f70a3..5d16cd8e2 100644 --- a/dapp/src/components/Modals/Staking/StakeForm/Details.tsx +++ b/dapp/src/components/Modals/Staking/StakeForm/Details.tsx @@ -1,9 +1,9 @@ import React from "react" import { List } from "@chakra-ui/react" -import { useTransactionDetails } from "../../../../hooks" -import TransactionDetailsAmountItem from "../../../shared/TransactionDetails/AmountItem" -import { CurrencyType } from "../../../../types" -import { useTokenAmountFormValue } from "../../../shared/TokenAmountForm/TokenAmountFormBase" +import TransactionDetailsAmountItem from "~/components/shared/TransactionDetails/AmountItem" +import { useTokenAmountFormValue } from "~/components/shared/TokenAmountForm/TokenAmountFormBase" +import { useTransactionDetails } from "~/hooks" +import { CurrencyType } from "~/types" function Details({ currency }: { currency: CurrencyType }) { const value = useTokenAmountFormValue() diff --git a/dapp/src/components/Modals/Staking/StakeForm/index.tsx b/dapp/src/components/Modals/Staking/StakeForm/index.tsx index 635e17e23..5f9b57bf0 100644 --- a/dapp/src/components/Modals/Staking/StakeForm/index.tsx +++ b/dapp/src/components/Modals/Staking/StakeForm/index.tsx @@ -1,10 +1,10 @@ import React, { useCallback } from "react" import { Button } from "@chakra-ui/react" -import { BITCOIN_MIN_AMOUNT } from "../../../../constants" -import { ModalStep } from "../../../../contexts" -import { useWalletContext, useTransactionContext } from "../../../../hooks" -import TokenAmountForm from "../../../shared/TokenAmountForm" -import { TokenAmountFormValues } from "../../../shared/TokenAmountForm/TokenAmountFormBase" +import { BITCOIN_MIN_AMOUNT } from "~/constants" +import { ModalStep } from "~/contexts" +import TokenAmountForm from "~/components/shared/TokenAmountForm" +import { TokenAmountFormValues } from "~/components/shared/TokenAmountForm/TokenAmountFormBase" +import { useWalletContext, useTransactionContext } from "~/hooks" import Details from "./Details" function StakeForm({ goNext }: ModalStep) { diff --git a/dapp/src/components/Modals/Staking/components/StakingSteps.tsx b/dapp/src/components/Modals/Staking/components/StakingSteps.tsx index a0ebfd4cb..4f0a11d06 100644 --- a/dapp/src/components/Modals/Staking/components/StakingSteps.tsx +++ b/dapp/src/components/Modals/Staking/components/StakingSteps.tsx @@ -6,9 +6,9 @@ import { ModalFooter, ModalHeader, } from "@chakra-ui/react" -import { TextLg, TextMd } from "../../../shared/Typography" -import StepperBase, { StepBase } from "../../../shared/StepperBase" -import Spinner from "../../../shared/Spinner" +import { TextLg, TextMd } from "~/components/shared/Typography" +import StepperBase, { StepBase } from "~/components/shared/StepperBase" +import Spinner from "~/components/shared/Spinner" export function Title({ children }: { children: React.ReactNode }) { return {children} diff --git a/dapp/src/components/Modals/Staking/index.tsx b/dapp/src/components/Modals/Staking/index.tsx index 78d04706c..8bad1b0c4 100644 --- a/dapp/src/components/Modals/Staking/index.tsx +++ b/dapp/src/components/Modals/Staking/index.tsx @@ -1,7 +1,7 @@ import React from "react" -import { useModalFlowContext } from "../../../hooks" +import { useModalFlowContext } from "~/hooks" +import ModalBase from "~/components/shared/ModalBase" import Overview from "./Overview" -import ModalBase from "../../shared/ModalBase" import ActionForm from "../ActionForm" import SignMessage from "./SignMessage" import DepositBTC from "./DepositBTC" diff --git a/dapp/src/components/Modals/Support/MissingAccount.tsx b/dapp/src/components/Modals/Support/MissingAccount.tsx index 2c32b354e..df879d260 100644 --- a/dapp/src/components/Modals/Support/MissingAccount.tsx +++ b/dapp/src/components/Modals/Support/MissingAccount.tsx @@ -7,10 +7,10 @@ import { ModalFooter, ModalHeader, } from "@chakra-ui/react" -import { CurrencyType, RequestAccountParams } from "../../../types" -import { TextMd } from "../../shared/Typography" -import Alert from "../../shared/Alert" -import { getCurrencyByType } from "../../../utils" +import { TextMd } from "~/components/shared/Typography" +import Alert from "~/components/shared/Alert" +import { getCurrencyByType } from "~/utils" +import { CurrencyType, RequestAccountParams } from "~/types" type MissingAccountProps = { currency: CurrencyType diff --git a/dapp/src/components/Modals/Support/index.tsx b/dapp/src/components/Modals/Support/index.tsx index c6784fff4..ca6e51453 100644 --- a/dapp/src/components/Modals/Support/index.tsx +++ b/dapp/src/components/Modals/Support/index.tsx @@ -3,9 +3,9 @@ import { useRequestBitcoinAccount, useRequestEthereumAccount, useWalletContext, -} from "../../../hooks" +} from "~/hooks" +import { ConnectBTCAccount, ConnectETHAccount } from "~/static/icons" import MissingAccount from "./MissingAccount" -import { ConnectBTCAccount, ConnectETHAccount } from "../../../static/icons" export default function SupportWrapper({ children, diff --git a/dapp/src/components/Overview/PositionDetails.tsx b/dapp/src/components/Overview/PositionDetails.tsx index c1de13f71..907be66f1 100644 --- a/dapp/src/components/Overview/PositionDetails.tsx +++ b/dapp/src/components/Overview/PositionDetails.tsx @@ -10,10 +10,10 @@ import { CardProps, useBoolean, } from "@chakra-ui/react" -import { Info } from "../../static/icons" +import { CurrencyBalanceWithConversion } from "~/components/shared/CurrencyBalanceWithConversion" +import { TextMd } from "~/components/shared/Typography" +import { Info } from "~/static/icons" import StakingModal from "../Modals/Staking" -import { CurrencyBalanceWithConversion } from "../shared/CurrencyBalanceWithConversion" -import { TextMd } from "../shared/Typography" export default function PositionDetails(props: CardProps) { const [isOpenStakingModal, stakingModal] = useBoolean() diff --git a/dapp/src/components/Overview/Statistics.tsx b/dapp/src/components/Overview/Statistics.tsx index 8b9c5979e..e8a5df0c5 100644 --- a/dapp/src/components/Overview/Statistics.tsx +++ b/dapp/src/components/Overview/Statistics.tsx @@ -1,6 +1,6 @@ import React from "react" import { CardBody, Card, CardProps } from "@chakra-ui/react" -import { TextMd } from "../shared/Typography" +import { TextMd } from "~/components/shared/Typography" export default function Statistics(props: CardProps) { return ( diff --git a/dapp/src/components/Overview/TransactionHistory.tsx b/dapp/src/components/Overview/TransactionHistory.tsx index e0ff1fb26..557556bd4 100644 --- a/dapp/src/components/Overview/TransactionHistory.tsx +++ b/dapp/src/components/Overview/TransactionHistory.tsx @@ -1,6 +1,6 @@ import React from "react" import { CardBody, Card, CardProps } from "@chakra-ui/react" -import { TextMd } from "../shared/Typography" +import { TextMd } from "~/components/shared/Typography" export default function TransactionHistory(props: CardProps) { return ( diff --git a/dapp/src/components/Overview/index.tsx b/dapp/src/components/Overview/index.tsx index 0ac2b4041..1bee1a175 100644 --- a/dapp/src/components/Overview/index.tsx +++ b/dapp/src/components/Overview/index.tsx @@ -1,12 +1,12 @@ import React from "react" import { Button, Flex, Grid, HStack, Icon, Switch } from "@chakra-ui/react" +import { useDocsDrawer } from "~/hooks" +import { TextSm } from "~/components/shared/Typography" +import { ArrowUpRight } from "~/static/icons" +import { USD } from "~/constants" import PositionDetails from "./PositionDetails" import Statistics from "./Statistics" import TransactionHistory from "./TransactionHistory" -import { USD } from "../../constants" -import { ArrowUpRight } from "../../static/icons" -import { TextSm } from "../shared/Typography" -import { useDocsDrawer } from "../../hooks" export default function Overview() { const { onOpen } = useDocsDrawer() diff --git a/dapp/src/components/Sidebar/index.tsx b/dapp/src/components/Sidebar/index.tsx index a7625698f..2217cfe7c 100644 --- a/dapp/src/components/Sidebar/index.tsx +++ b/dapp/src/components/Sidebar/index.tsx @@ -1,6 +1,6 @@ import React from "react" import { Box, Button, useMultiStyleConfig } from "@chakra-ui/react" -import { useDocsDrawer, useSidebar } from "../../hooks" +import { useDocsDrawer, useSidebar } from "~/hooks" export default function Sidebar() { const { isOpen } = useSidebar() diff --git a/dapp/src/components/shared/Alert/index.tsx b/dapp/src/components/shared/Alert/index.tsx index 2ab05a8f2..cb3d94fd1 100644 --- a/dapp/src/components/shared/Alert/index.tsx +++ b/dapp/src/components/shared/Alert/index.tsx @@ -7,7 +7,7 @@ import { Icon, useMultiStyleConfig, } from "@chakra-ui/react" -import { AlertInfo, ArrowUpRight } from "../../../static/icons" +import { AlertInfo, ArrowUpRight } from "~/static/icons" const ICONS = { info: AlertInfo, diff --git a/dapp/src/components/shared/CurrencyBalance/index.tsx b/dapp/src/components/shared/CurrencyBalance/index.tsx index f44f7505e..65991979a 100644 --- a/dapp/src/components/shared/CurrencyBalance/index.tsx +++ b/dapp/src/components/shared/CurrencyBalance/index.tsx @@ -4,8 +4,8 @@ import { formatTokenAmount, getCurrencyByType, numberToLocaleString, -} from "../../../utils" -import { CurrencyType } from "../../../types" +} from "~/utils" +import { CurrencyType } from "~/types" export type CurrencyBalanceProps = { currency: CurrencyType diff --git a/dapp/src/components/shared/ModalBase/index.tsx b/dapp/src/components/shared/ModalBase/index.tsx index cfeb34472..034527614 100644 --- a/dapp/src/components/shared/ModalBase/index.tsx +++ b/dapp/src/components/shared/ModalBase/index.tsx @@ -5,12 +5,12 @@ import { ModalContent, ModalOverlay, } from "@chakra-ui/react" +import { useSidebar } from "~/hooks" import { ModalFlowContext, ModalFlowContextValue, TransactionContextProvider, -} from "../../../contexts" -import { useSidebar } from "../../../hooks" +} from "~/contexts" import SupportWrapper from "../../Modals/Support" export default function ModalBase({ diff --git a/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx b/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx index 7324f2251..3f07bfe45 100644 --- a/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx +++ b/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx @@ -1,7 +1,7 @@ import React from "react" import { FormikProps, useField } from "formik" +import { CurrencyType } from "~/types" import { Form, FormTokenBalanceInput } from "../Form" -import { CurrencyType } from "../../../types" const TOKEN_AMOUNT_FIELD_NAME = "amount" diff --git a/dapp/src/components/shared/TokenAmountForm/index.tsx b/dapp/src/components/shared/TokenAmountForm/index.tsx index d6d0716c1..50a792af8 100644 --- a/dapp/src/components/shared/TokenAmountForm/index.tsx +++ b/dapp/src/components/shared/TokenAmountForm/index.tsx @@ -1,5 +1,5 @@ import { FormikErrors, withFormik } from "formik" -import { getErrorsObj, validateTokenAmount } from "../../../utils" +import { getErrorsObj, validateTokenAmount } from "~/utils" import TokenAmountFormBase, { TokenAmountFormBaseProps, TokenAmountFormValues, diff --git a/dapp/src/components/shared/TokenBalanceInput/index.tsx b/dapp/src/components/shared/TokenBalanceInput/index.tsx index 82aa75fee..289451c11 100644 --- a/dapp/src/components/shared/TokenBalanceInput/index.tsx +++ b/dapp/src/components/shared/TokenBalanceInput/index.tsx @@ -16,13 +16,13 @@ import { fixedPointNumberToString, getCurrencyByType, userAmountToBigInt, -} from "../../../utils" -import { CurrencyType } from "../../../types" +} from "~/utils" +import { AlertInfo } from "~/static/icons" +import { CurrencyType } from "~/types" import NumberFormatInput, { NumberFormatInputValues, } from "../NumberFormatInput" import { CurrencyBalance } from "../CurrencyBalance" -import { AlertInfo } from "../../../static/icons" const VARIANT = "balance" diff --git a/dapp/src/constants/currency.ts b/dapp/src/constants/currency.ts index 420adb8b6..75b1c572b 100644 --- a/dapp/src/constants/currency.ts +++ b/dapp/src/constants/currency.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyType } from "../types" +import { Currency, CurrencyType } from "~/types" export const BITCOIN: Currency = { name: "Bitcoin", diff --git a/dapp/src/contexts/TransactionContext.tsx b/dapp/src/contexts/TransactionContext.tsx index 384bfb2e5..47bb3b801 100644 --- a/dapp/src/contexts/TransactionContext.tsx +++ b/dapp/src/contexts/TransactionContext.tsx @@ -1,5 +1,5 @@ import React, { createContext, useMemo, useState } from "react" -import { TokenAmount } from "../types" +import { TokenAmount } from "~/types" type TransactionContextValue = { tokenAmount?: TokenAmount diff --git a/dapp/src/hooks/useDepositBTCTransaction.ts b/dapp/src/hooks/useDepositBTCTransaction.ts index a629e6485..861e55870 100644 --- a/dapp/src/hooks/useDepositBTCTransaction.ts +++ b/dapp/src/hooks/useDepositBTCTransaction.ts @@ -1,5 +1,5 @@ import { useCallback } from "react" -import { OnSuccessCallback } from "../types" +import { OnSuccessCallback } from "~/types" export function useDepositBTCTransaction(onSuccess?: OnSuccessCallback) { // TODO: sending transactions using the SDK diff --git a/dapp/src/hooks/useDocsDrawer.ts b/dapp/src/hooks/useDocsDrawer.ts index 4ce8bba3e..e560afa83 100644 --- a/dapp/src/hooks/useDocsDrawer.ts +++ b/dapp/src/hooks/useDocsDrawer.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { DocsDrawerContext } from "../contexts" +import { DocsDrawerContext } from "~/contexts" export function useDocsDrawer() { const context = useContext(DocsDrawerContext) diff --git a/dapp/src/hooks/useModalFlowContext.ts b/dapp/src/hooks/useModalFlowContext.ts index 48882c561..fafb6a565 100644 --- a/dapp/src/hooks/useModalFlowContext.ts +++ b/dapp/src/hooks/useModalFlowContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { ModalFlowContext } from "../contexts" +import { ModalFlowContext } from "~/contexts" export function useModalFlowContext() { const context = useContext(ModalFlowContext) diff --git a/dapp/src/hooks/useRequestBitcoinAccount.ts b/dapp/src/hooks/useRequestBitcoinAccount.ts index 036db196d..d780eb016 100644 --- a/dapp/src/hooks/useRequestBitcoinAccount.ts +++ b/dapp/src/hooks/useRequestBitcoinAccount.ts @@ -1,8 +1,8 @@ import { useRequestAccount } from "@ledgerhq/wallet-api-client-react" import { useCallback, useContext, useEffect } from "react" -import { CURRENCY_ID_BITCOIN } from "../constants" -import { UseRequestAccountReturn } from "../types" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" +import { UseRequestAccountReturn } from "~/types" +import { CURRENCY_ID_BITCOIN } from "~/constants" export function useRequestBitcoinAccount(): UseRequestAccountReturn { const { setBtcAccount } = useContext(WalletContext) diff --git a/dapp/src/hooks/useRequestEthereumAccount.ts b/dapp/src/hooks/useRequestEthereumAccount.ts index 5c3cad1f1..d1dd87ad7 100644 --- a/dapp/src/hooks/useRequestEthereumAccount.ts +++ b/dapp/src/hooks/useRequestEthereumAccount.ts @@ -1,8 +1,8 @@ import { useRequestAccount } from "@ledgerhq/wallet-api-client-react" import { useCallback, useContext, useEffect } from "react" -import { CURRENCY_ID_ETHEREUM } from "../constants" -import { UseRequestAccountReturn } from "../types" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" +import { UseRequestAccountReturn } from "~/types" +import { CURRENCY_ID_ETHEREUM } from "~/constants" export function useRequestEthereumAccount(): UseRequestAccountReturn { const { setEthAccount } = useContext(WalletContext) diff --git a/dapp/src/hooks/useSidebar.ts b/dapp/src/hooks/useSidebar.ts index 986143a89..714330b48 100644 --- a/dapp/src/hooks/useSidebar.ts +++ b/dapp/src/hooks/useSidebar.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { SidebarContext } from "../contexts" +import { SidebarContext } from "~/contexts" export function useSidebar() { const context = useContext(SidebarContext) diff --git a/dapp/src/hooks/useSignMessage.ts b/dapp/src/hooks/useSignMessage.ts index cc3cadc3e..21ef804b0 100644 --- a/dapp/src/hooks/useSignMessage.ts +++ b/dapp/src/hooks/useSignMessage.ts @@ -1,7 +1,7 @@ import { useSignMessage as useSignMessageLedgerLive } from "@ledgerhq/wallet-api-client-react" import { useCallback, useEffect } from "react" +import { OnSuccessCallback } from "~/types" import { useWalletContext } from "./useWalletContext" -import { OnSuccessCallback } from "../types" const SIGN_MESSAGE = "Test message" diff --git a/dapp/src/hooks/useTransactionContext.ts b/dapp/src/hooks/useTransactionContext.ts index d28c8bf1b..85b663a51 100644 --- a/dapp/src/hooks/useTransactionContext.ts +++ b/dapp/src/hooks/useTransactionContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { TransactionContext } from "../contexts" +import { TransactionContext } from "~/contexts" export function useTransactionContext() { const context = useContext(TransactionContext) diff --git a/dapp/src/hooks/useWalletContext.ts b/dapp/src/hooks/useWalletContext.ts index 0da19204b..c786a76dd 100644 --- a/dapp/src/hooks/useWalletContext.ts +++ b/dapp/src/hooks/useWalletContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" export function useWalletContext() { const context = useContext(WalletContext) diff --git a/dapp/src/utils/currency.ts b/dapp/src/utils/currency.ts index 39eda0651..99d93710a 100644 --- a/dapp/src/utils/currency.ts +++ b/dapp/src/utils/currency.ts @@ -1,5 +1,5 @@ -import { CURRENCIES_BY_TYPE } from "../constants" -import { Currency, CurrencyType } from "../types" +import { Currency, CurrencyType } from "~/types" +import { CURRENCIES_BY_TYPE } from "~/constants" export const getCurrencyByType = (currency: CurrencyType): Currency => CURRENCIES_BY_TYPE[currency] diff --git a/dapp/src/utils/forms.ts b/dapp/src/utils/forms.ts index 9f7f34759..a2fc7b8c4 100644 --- a/dapp/src/utils/forms.ts +++ b/dapp/src/utils/forms.ts @@ -1,4 +1,4 @@ -import { CurrencyType } from "../types" +import { CurrencyType } from "~/types" import { getCurrencyByType } from "./currency" import { formatTokenAmount } from "./numbers" diff --git a/dapp/vite.config.ts b/dapp/vite.config.ts index 14ad46477..71034c086 100644 --- a/dapp/vite.config.ts +++ b/dapp/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig } from "vite" import react from "@vitejs/plugin-react" import { nodePolyfills } from "vite-plugin-node-polyfills" -import eslint from "vite-plugin-eslint" import { resolve } from "path" @@ -11,5 +10,5 @@ export default defineConfig({ "~": resolve(__dirname, "./src"), }, }, - plugins: [nodePolyfills(), react(), eslint()], + plugins: [nodePolyfills(), react()], }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48a4c27dc..89f1905c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -181,9 +181,6 @@ importers: vite: specifier: ^5.0.2 version: 5.0.2 - vite-plugin-eslint: - specifier: ^1.8.1 - version: 1.8.1(eslint@8.54.0)(vite@5.0.2) vite-plugin-node-polyfills: specifier: ^0.19.0 version: 0.19.0(vite@5.0.2) @@ -385,7 +382,7 @@ packages: '@babel/traverse': 7.23.4 '@babel/types': 7.23.4 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -1629,7 +1626,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.4 '@babel/types': 7.23.4 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3182,7 +3179,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 espree: 9.6.1 globals: 13.23.0 ignore: 5.3.0 @@ -3787,7 +3784,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -5100,14 +5097,6 @@ packages: magic-string: 0.30.5 dev: true - /@rollup/pluginutils@4.2.1: - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/pluginutils@5.1.0: resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} @@ -5813,7 +5802,7 @@ packages: '@typescript-eslint/type-utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/visitor-keys': 6.12.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.54.0 graphemer: 1.4.0 ignore: 5.3.0 @@ -5858,7 +5847,7 @@ packages: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) '@typescript-eslint/visitor-keys': 6.12.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.54.0 typescript: 5.3.2 transitivePeerDependencies: @@ -5909,7 +5898,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.54.0 ts-api-utils: 1.0.3(typescript@5.3.2) typescript: 5.3.2 @@ -5956,7 +5945,7 @@ packages: dependencies: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/visitor-keys': 6.12.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -7986,6 +7975,17 @@ packages: dependencies: ms: 2.1.3 + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -9046,7 +9046,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -13992,14 +13992,6 @@ packages: bn.js: 5.2.1 dev: true - /rollup@2.79.1: - resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.3 - dev: true - /rollup@4.5.1: resolution: {integrity: sha512-0EQribZoPKpb5z1NW/QYm3XSR//Xr8BeEXU49Lc/mQmpmVVG5jPUVrpc2iptup/0WMrY9mzas0fxH+TjYvG2CA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -15568,19 +15560,6 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-eslint@1.8.1(eslint@8.54.0)(vite@5.0.2): - resolution: {integrity: sha512-PqdMf3Y2fLO9FsNPmMX+//2BF5SF8nEWspZdgl4kSt7UvHDRHVVfHvxsD7ULYzZrJDGRxR81Nq7TOFgwMnUang==} - peerDependencies: - eslint: '>=7' - vite: '>=2' - dependencies: - '@rollup/pluginutils': 4.2.1 - '@types/eslint': 8.44.7 - eslint: 8.54.0 - rollup: 2.79.1 - vite: 5.0.2 - dev: true - /vite-plugin-node-polyfills@0.19.0(vite@5.0.2): resolution: {integrity: sha512-AhdVxAmVnd1doUlIRGUGV6ZRPfB9BvIwDF10oCOmL742IsvsFIAV4tSMxSfu5e0Px0QeJLgWVOSbtHIvblzqMw==} peerDependencies: @@ -15601,7 +15580,7 @@ packages: vite: optional: true dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.2(typescript@5.3.2) vite: 5.0.2