From 7af0efa8d8d262384694846ce0dd9ef119436279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20G=C5=82ownia?= Date: Wed, 30 Mar 2022 11:49:48 +0200 Subject: [PATCH] Enable @typescript-eslint/consistent-type-imports eslint rule --- .eslintrc.json | 7 +++++++ .github/workflows/test.yml | 16 ++++++++-------- .../src/app/components/blocks/block-data.tsx | 2 +- .../src/app/components/blocks/blocks-data.tsx | 2 +- .../src/app/components/jump-to/index.tsx | 2 +- .../src/app/components/route-title/index.tsx | 3 ++- .../src/app/components/sub-heading/index.tsx | 2 +- apps/explorer/src/app/components/table/index.tsx | 3 ++- .../src/app/components/txs/block-txs-data.tsx | 2 +- apps/explorer/src/app/components/txs/tx-list.tsx | 2 +- .../src/app/components/txs/txs-per-block.tsx | 2 +- .../websocket/tendermint-websocket-context.ts | 2 +- apps/explorer/src/app/routes/assets/index.tsx | 2 +- .../src/app/routes/blocks/home/index.tsx | 2 +- apps/explorer/src/app/routes/blocks/id/block.tsx | 2 +- .../app/routes/blocks/tendermint-new-block.d.ts | 3 ++- apps/explorer/src/app/routes/genesis/index.tsx | 2 +- .../genesis/tendermint-genesis-response.d.ts | 1 + .../explorer/src/app/routes/governance/index.tsx | 2 +- apps/explorer/src/app/routes/markets/index.tsx | 2 +- .../src/app/routes/network-parameters/index.tsx | 2 +- .../explorer/src/app/routes/parties/id/index.tsx | 4 ++-- apps/explorer/src/app/routes/pending/index.tsx | 2 +- apps/explorer/src/app/routes/txs/home/index.tsx | 2 +- apps/explorer/src/app/routes/txs/id/index.tsx | 4 ++-- .../src/app/routes/txs/id/tx-content.tsx | 2 +- .../src/app/routes/txs/id/tx-details.tsx | 2 +- .../explorer/src/app/routes/validators/index.tsx | 4 ++-- apps/stats/src/report-web-vitals.ts | 2 +- apps/trading/components/app-loader/index.tsx | 2 +- .../components/page-query-container/index.tsx | 7 ++++--- .../components/web3-container/web3-container.tsx | 3 ++- apps/trading/pages/_app.page.tsx | 2 +- apps/trading/pages/markets/[marketId].page.tsx | 2 +- apps/trading/pages/markets/grid-tabs.tsx | 10 ++-------- apps/trading/pages/markets/trade-grid.tsx | 5 +++-- libs/deal-ticket/src/deal-ticket-container.tsx | 2 +- libs/deal-ticket/src/deal-ticket-limit.tsx | 6 +++--- libs/deal-ticket/src/deal-ticket-manager.tsx | 2 +- libs/deal-ticket/src/deal-ticket-market.tsx | 6 +++--- libs/deal-ticket/src/deal-ticket.spec.tsx | 4 ++-- libs/deal-ticket/src/deal-ticket.tsx | 7 ++++--- libs/deal-ticket/src/expiry-selector.tsx | 2 +- libs/deal-ticket/src/order-dialog.tsx | 7 ++++--- libs/deal-ticket/src/side-selector.tsx | 2 +- libs/deal-ticket/src/submit-button.tsx | 6 +++--- libs/deal-ticket/src/time-in-force-selector.tsx | 2 +- libs/deal-ticket/src/type-selector.tsx | 2 +- libs/deal-ticket/src/use-order-state.ts | 3 ++- libs/deal-ticket/src/use-order-submit.spec.tsx | 9 ++++----- libs/deal-ticket/src/use-order-submit.ts | 4 ++-- libs/market-list/src/lib/market-list-table.tsx | 2 +- libs/market-list/src/lib/markets-container.tsx | 5 ++++- .../market-list/src/lib/markets-data-provider.ts | 4 ++-- .../good-threshold-indicator.tsx | 2 +- .../promoted-stats-item/promoted-stats-item.tsx | 2 +- .../components/stats-manager/stats-manager.tsx | 2 +- .../src/components/table-row/table-row.tsx | 2 +- libs/network-stats/src/config/stats-fields.ts | 2 +- libs/order-list/src/order-list-manager.spec.tsx | 2 +- libs/order-list/src/order-list-manager.tsx | 2 +- libs/order-list/src/order-list.spec.tsx | 2 +- libs/order-list/src/order-list.tsx | 4 ++-- libs/order-list/src/use-orders.spec.tsx | 11 ++++++----- libs/order-list/src/use-orders.ts | 6 +++--- .../positions/src/lib/positions-data-provider.ts | 4 ++-- libs/positions/src/lib/positions-manager.tsx | 4 ++-- libs/positions/src/lib/positions-table.spec.tsx | 2 +- libs/positions/src/lib/positions-table.tsx | 2 +- .../src/hooks/use-apply-grid-transaction.ts | 2 +- .../src/lib/grid-cells/flash-cell.stories.tsx | 2 +- .../src/components/ag-grid/ag-grid-dark.tsx | 2 +- .../src/components/ag-grid/ag-grid-light.tsx | 2 +- .../components/async-renderer/async-renderer.tsx | 2 +- .../src/components/button/button.stories.tsx | 2 +- libs/ui-toolkit/src/components/button/button.tsx | 6 ++++-- .../src/components/callout/callout.stories.tsx | 2 +- .../src/components/callout/callout.tsx | 3 ++- .../src/components/dialog/dialog.stories.tsx | 2 +- libs/ui-toolkit/src/components/dialog/dialog.tsx | 5 +++-- .../etherscan-link/etherscan-link.stories.tsx | 2 +- .../components/etherscan-link/etherscan-link.tsx | 2 +- .../src/components/form-group/form-group.tsx | 2 +- .../components/form-group/from-group.stories.tsx | 2 +- .../src/components/icon/icon.stories.tsx | 2 +- libs/ui-toolkit/src/components/icon/icon.tsx | 3 ++- .../input-error/input-error.stories.tsx | 2 +- .../src/components/input-error/input-error.tsx | 2 +- .../src/components/input/input.stories.tsx | 2 +- libs/ui-toolkit/src/components/input/input.tsx | 6 ++++-- .../src/components/lozenge/lozenge.stories.tsx | 2 +- .../src/components/lozenge/lozenge.tsx | 2 +- .../src/components/select/select.stories.tsx | 2 +- libs/ui-toolkit/src/components/select/select.tsx | 3 ++- .../src/components/splash/splash.stories.tsx | 5 +++-- libs/ui-toolkit/src/components/splash/splash.tsx | 2 +- .../components/text-area/text-area.stories.tsx | 2 +- .../src/components/text-area/text-area.tsx | 3 ++- .../theme-switcher/theme-switcher.stories.tsx | 2 +- .../src/components/vega-logo/lozenge.stories.tsx | 2 +- libs/ui-toolkit/src/utils/contrast.stories.tsx | 2 +- libs/wallet/src/connect-dialog.test.tsx | 5 +++-- libs/wallet/src/connect-dialog.tsx | 2 +- libs/wallet/src/connectors/index.ts | 2 +- libs/wallet/src/connectors/injected-connector.ts | 2 +- libs/wallet/src/connectors/rest-connector.ts | 10 ++++++---- libs/wallet/src/context.ts | 6 +++--- libs/wallet/src/provider.test.tsx | 2 +- libs/wallet/src/provider.tsx | 16 +++++----------- libs/wallet/src/rest-connector-form.tsx | 2 +- libs/wallet/src/use-vega-transaction.spec.tsx | 7 ++++--- libs/wallet/src/use-vega-transaction.ts | 4 ++-- libs/web3/src/lib/types.ts | 6 +++--- libs/web3/src/lib/web3-connect-dialog.tsx | 2 +- libs/web3/src/lib/web3-provider.tsx | 2 +- 115 files changed, 206 insertions(+), 184 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 6a841772d..dd2d9f7ed 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,6 +48,13 @@ "ts-check": false, "minimumDescriptionLength": 10 } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "prefer": "type-imports", + "disallowTypeAnnotations": true + } ] } }, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3dbad68b..4060da6d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,11 +31,11 @@ jobs: run: yarn install - name: Check formatting run: yarn nx format:check - - name: Check formatting - run: yarn eslint - - name: Check formatting + - name: Lint affected + run: yarn nx affected:lint + - name: Test affected run: yarn nx affected:test - - name: Check formatting + - name: Build affected run: yarn nx affected:build pr: name: Test and lint - PR @@ -59,9 +59,9 @@ jobs: run: yarn install - name: Check formatting run: yarn nx format:check - - name: Check formatting - run: yarn eslint - - name: Check formatting + - name: Lint affected + run: yarn nx affected:lint + - name: Test affected run: yarn nx affected:test - - name: Check formatting + - name: Build affected run: yarn nx affected:build diff --git a/apps/explorer/src/app/components/blocks/block-data.tsx b/apps/explorer/src/app/components/blocks/block-data.tsx index f155679b6..2fedb94ca 100644 --- a/apps/explorer/src/app/components/blocks/block-data.tsx +++ b/apps/explorer/src/app/components/blocks/block-data.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { BlockMeta } from '../../routes/blocks/tendermint-blockchain-response'; +import type { BlockMeta } from '../../routes/blocks/tendermint-blockchain-response'; import { Routes } from '../../routes/router-config'; import { Link } from 'react-router-dom'; import { SecondsAgo } from '../seconds-ago'; diff --git a/apps/explorer/src/app/components/blocks/blocks-data.tsx b/apps/explorer/src/app/components/blocks/blocks-data.tsx index 66d1301e1..512da0dbe 100644 --- a/apps/explorer/src/app/components/blocks/blocks-data.tsx +++ b/apps/explorer/src/app/components/blocks/blocks-data.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { TendermintBlockchainResponse } from '../../routes/blocks/tendermint-blockchain-response'; +import type { TendermintBlockchainResponse } from '../../routes/blocks/tendermint-blockchain-response'; import { BlockData } from './block-data'; interface BlocksProps { diff --git a/apps/explorer/src/app/components/jump-to/index.tsx b/apps/explorer/src/app/components/jump-to/index.tsx index 075efa5c6..1e723f3f9 100644 --- a/apps/explorer/src/app/components/jump-to/index.tsx +++ b/apps/explorer/src/app/components/jump-to/index.tsx @@ -1,4 +1,4 @@ -import { HTMLInputTypeAttribute, SyntheticEvent } from 'react'; +import type { HTMLInputTypeAttribute, SyntheticEvent } from 'react'; import { Input, Button } from '@vegaprotocol/ui-toolkit'; interface JumpToProps { diff --git a/apps/explorer/src/app/components/route-title/index.tsx b/apps/explorer/src/app/components/route-title/index.tsx index 393844f0c..99a0a5f79 100644 --- a/apps/explorer/src/app/components/route-title/index.tsx +++ b/apps/explorer/src/app/components/route-title/index.tsx @@ -1,5 +1,6 @@ import classnames from 'classnames'; -import React, { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; +import React from 'react'; interface RouteTitleProps extends HTMLAttributes { children: React.ReactNode; diff --git a/apps/explorer/src/app/components/sub-heading/index.tsx b/apps/explorer/src/app/components/sub-heading/index.tsx index 094ef2faf..839176ca7 100644 --- a/apps/explorer/src/app/components/sub-heading/index.tsx +++ b/apps/explorer/src/app/components/sub-heading/index.tsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; interface SubHeadingProps extends HTMLAttributes { children: React.ReactNode; diff --git a/apps/explorer/src/app/components/table/index.tsx b/apps/explorer/src/app/components/table/index.tsx index 186306c45..c23ef343e 100644 --- a/apps/explorer/src/app/components/table/index.tsx +++ b/apps/explorer/src/app/components/table/index.tsx @@ -1,4 +1,5 @@ -import React, { ThHTMLAttributes } from 'react'; +import type { ThHTMLAttributes } from 'react'; +import React from 'react'; import classnames from 'classnames'; interface TableProps extends ThHTMLAttributes { diff --git a/apps/explorer/src/app/components/txs/block-txs-data.tsx b/apps/explorer/src/app/components/txs/block-txs-data.tsx index bde3f6187..7ef9c1410 100644 --- a/apps/explorer/src/app/components/txs/block-txs-data.tsx +++ b/apps/explorer/src/app/components/txs/block-txs-data.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { TendermintBlockchainResponse } from '../../routes/blocks/tendermint-blockchain-response'; +import type { TendermintBlockchainResponse } from '../../routes/blocks/tendermint-blockchain-response'; import { BlockData } from '../blocks'; import { TxsPerBlock } from './txs-per-block'; diff --git a/apps/explorer/src/app/components/txs/tx-list.tsx b/apps/explorer/src/app/components/txs/tx-list.tsx index 1a9198fbc..98f3500ca 100644 --- a/apps/explorer/src/app/components/txs/tx-list.tsx +++ b/apps/explorer/src/app/components/txs/tx-list.tsx @@ -1,4 +1,4 @@ -import { TendermintUnconfirmedTransactionsResponse } from '../../routes/txs/tendermint-unconfirmed-transactions-response.d'; +import type { TendermintUnconfirmedTransactionsResponse } from '../../routes/txs/tendermint-unconfirmed-transactions-response.d'; interface TxsProps { data: TendermintUnconfirmedTransactionsResponse | undefined; diff --git a/apps/explorer/src/app/components/txs/txs-per-block.tsx b/apps/explorer/src/app/components/txs/txs-per-block.tsx index 67613281e..808d3adf4 100644 --- a/apps/explorer/src/app/components/txs/txs-per-block.tsx +++ b/apps/explorer/src/app/components/txs/txs-per-block.tsx @@ -1,5 +1,5 @@ import useFetch from '../../hooks/use-fetch'; -import { ChainExplorerTxResponse } from '../../routes/types/chain-explorer-response'; +import type { ChainExplorerTxResponse } from '../../routes/types/chain-explorer-response'; import { Routes } from '../../routes/router-config'; import { DATA_SOURCES } from '../../config'; import { Link } from 'react-router-dom'; diff --git a/apps/explorer/src/app/contexts/websocket/tendermint-websocket-context.ts b/apps/explorer/src/app/contexts/websocket/tendermint-websocket-context.ts index 8ee2f6400..089b52d70 100644 --- a/apps/explorer/src/app/contexts/websocket/tendermint-websocket-context.ts +++ b/apps/explorer/src/app/contexts/websocket/tendermint-websocket-context.ts @@ -1,5 +1,5 @@ import React from 'react'; -import { WebSocketHook } from 'react-use-websocket/dist/lib/types'; +import type { WebSocketHook } from 'react-use-websocket/dist/lib/types'; export type WebsocketContextShape = WebSocketHook; diff --git a/apps/explorer/src/app/routes/assets/index.tsx b/apps/explorer/src/app/routes/assets/index.tsx index caa2ae40d..3fdf7f19e 100644 --- a/apps/explorer/src/app/routes/assets/index.tsx +++ b/apps/explorer/src/app/routes/assets/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { RouteTitle } from '../../components/route-title'; import { SubHeading } from '../../components/sub-heading'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; -import { AssetsQuery } from './__generated__/AssetsQuery'; +import type { AssetsQuery } from './__generated__/AssetsQuery'; export const ASSETS_QUERY = gql` query AssetsQuery { diff --git a/apps/explorer/src/app/routes/blocks/home/index.tsx b/apps/explorer/src/app/routes/blocks/home/index.tsx index 15a6c8425..b6fa12635 100644 --- a/apps/explorer/src/app/routes/blocks/home/index.tsx +++ b/apps/explorer/src/app/routes/blocks/home/index.tsx @@ -1,6 +1,6 @@ import { DATA_SOURCES } from '../../../config'; import useFetch from '../../../hooks/use-fetch'; -import { TendermintBlockchainResponse } from '../tendermint-blockchain-response'; +import type { TendermintBlockchainResponse } from '../tendermint-blockchain-response'; import { RouteTitle } from '../../../components/route-title'; import { RenderFetched } from '../../../components/render-fetched'; import { BlocksData, BlocksRefetch } from '../../../components/blocks'; diff --git a/apps/explorer/src/app/routes/blocks/id/block.tsx b/apps/explorer/src/app/routes/blocks/id/block.tsx index 0cddc8a28..a506c20d4 100644 --- a/apps/explorer/src/app/routes/blocks/id/block.tsx +++ b/apps/explorer/src/app/routes/blocks/id/block.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Link, useParams } from 'react-router-dom'; import { DATA_SOURCES } from '../../../config'; import useFetch from '../../../hooks/use-fetch'; -import { TendermintBlocksResponse } from '../tendermint-blocks-response'; +import type { TendermintBlocksResponse } from '../tendermint-blocks-response'; import { RouteTitle } from '../../../components/route-title'; import { SecondsAgo } from '../../../components/seconds-ago'; import { diff --git a/apps/explorer/src/app/routes/blocks/tendermint-new-block.d.ts b/apps/explorer/src/app/routes/blocks/tendermint-new-block.d.ts index 63e134689..4111b34ec 100644 --- a/apps/explorer/src/app/routes/blocks/tendermint-new-block.d.ts +++ b/apps/explorer/src/app/routes/blocks/tendermint-new-block.d.ts @@ -63,6 +63,7 @@ export interface Block { last_commit: LastCommit; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ResultBeginBlock {} export interface ResultEndBlock { @@ -81,7 +82,7 @@ export interface Data { } export interface Events { - "tm.event": string[]; + 'tm.event': string[]; } export interface Result { diff --git a/apps/explorer/src/app/routes/genesis/index.tsx b/apps/explorer/src/app/routes/genesis/index.tsx index 2b88c265c..960087c32 100644 --- a/apps/explorer/src/app/routes/genesis/index.tsx +++ b/apps/explorer/src/app/routes/genesis/index.tsx @@ -2,7 +2,7 @@ import { RouteTitle } from '../../components/route-title'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; import { DATA_SOURCES } from '../../config'; import useFetch from '../../hooks/use-fetch'; -import { TendermintGenesisResponse } from './tendermint-genesis-response'; +import type { TendermintGenesisResponse } from './tendermint-genesis-response'; const Genesis = () => { const { diff --git a/apps/explorer/src/app/routes/genesis/tendermint-genesis-response.d.ts b/apps/explorer/src/app/routes/genesis/tendermint-genesis-response.d.ts index c0105af37..afa61555a 100644 --- a/apps/explorer/src/app/routes/genesis/tendermint-genesis-response.d.ts +++ b/apps/explorer/src/app/routes/genesis/tendermint-genesis-response.d.ts @@ -13,6 +13,7 @@ export interface ValidatorAddresses { pub_key_types: string[]; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Version {} export interface ConsensusParams { diff --git a/apps/explorer/src/app/routes/governance/index.tsx b/apps/explorer/src/app/routes/governance/index.tsx index e55c99337..30af1c727 100644 --- a/apps/explorer/src/app/routes/governance/index.tsx +++ b/apps/explorer/src/app/routes/governance/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { RouteTitle } from '../../components/route-title'; import { SubHeading } from '../../components/sub-heading'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; -import { +import type { ProposalsQuery, ProposalsQuery_proposals_terms_change, } from './__generated__/ProposalsQuery'; diff --git a/apps/explorer/src/app/routes/markets/index.tsx b/apps/explorer/src/app/routes/markets/index.tsx index 075f8619d..dfe1adc78 100644 --- a/apps/explorer/src/app/routes/markets/index.tsx +++ b/apps/explorer/src/app/routes/markets/index.tsx @@ -1,5 +1,5 @@ import { gql, useQuery } from '@apollo/client'; -import { MarketsQuery } from './__generated__/MarketsQuery'; +import type { MarketsQuery } from './__generated__/MarketsQuery'; import React from 'react'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; diff --git a/apps/explorer/src/app/routes/network-parameters/index.tsx b/apps/explorer/src/app/routes/network-parameters/index.tsx index 28822cd80..cf0569618 100644 --- a/apps/explorer/src/app/routes/network-parameters/index.tsx +++ b/apps/explorer/src/app/routes/network-parameters/index.tsx @@ -1,6 +1,6 @@ import { gql, useQuery } from '@apollo/client'; import { RouteTitle } from '../../components/route-title'; -import { NetworkParametersQuery } from './__generated__/NetworkParametersQuery'; +import type { NetworkParametersQuery } from './__generated__/NetworkParametersQuery'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; export const NETWORK_PARAMETERS_QUERY = gql` diff --git a/apps/explorer/src/app/routes/parties/id/index.tsx b/apps/explorer/src/app/routes/parties/id/index.tsx index d9aed4dad..809af5bc3 100644 --- a/apps/explorer/src/app/routes/parties/id/index.tsx +++ b/apps/explorer/src/app/routes/parties/id/index.tsx @@ -7,8 +7,8 @@ import { SubHeading } from '../../../components/sub-heading'; import { SyntaxHighlighter } from '../../../components/syntax-highlighter'; import { DATA_SOURCES } from '../../../config'; import useFetch from '../../../hooks/use-fetch'; -import { TendermintSearchTransactionResponse } from '../tendermint-transaction-response'; -import { +import type { TendermintSearchTransactionResponse } from '../tendermint-transaction-response'; +import type { PartyAssetsQuery, PartyAssetsQueryVariables, } from './__generated__/PartyAssetsQuery'; diff --git a/apps/explorer/src/app/routes/pending/index.tsx b/apps/explorer/src/app/routes/pending/index.tsx index 1955f0aeb..97bb5ab93 100644 --- a/apps/explorer/src/app/routes/pending/index.tsx +++ b/apps/explorer/src/app/routes/pending/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { DATA_SOURCES } from '../../config'; import useFetch from '../../hooks/use-fetch'; -import { TendermintUnconfirmedTransactionsResponse } from '../txs/tendermint-unconfirmed-transactions-response.d'; +import type { TendermintUnconfirmedTransactionsResponse } from '../txs/tendermint-unconfirmed-transactions-response.d'; import { TxList } from '../../components/txs'; import { RouteTitle } from '../../components/route-title'; diff --git a/apps/explorer/src/app/routes/txs/home/index.tsx b/apps/explorer/src/app/routes/txs/home/index.tsx index fc382840d..558fc1d34 100644 --- a/apps/explorer/src/app/routes/txs/home/index.tsx +++ b/apps/explorer/src/app/routes/txs/home/index.tsx @@ -1,5 +1,5 @@ import useFetch from '../../../hooks/use-fetch'; -import { TendermintBlockchainResponse } from '../../blocks/tendermint-blockchain-response'; +import type { TendermintBlockchainResponse } from '../../blocks/tendermint-blockchain-response'; import { DATA_SOURCES } from '../../../config'; import { RouteTitle } from '../../../components/route-title'; import { BlocksRefetch } from '../../../components/blocks'; diff --git a/apps/explorer/src/app/routes/txs/id/index.tsx b/apps/explorer/src/app/routes/txs/id/index.tsx index bb78aed50..93a27887d 100644 --- a/apps/explorer/src/app/routes/txs/id/index.tsx +++ b/apps/explorer/src/app/routes/txs/id/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { useParams } from 'react-router-dom'; import useFetch from '../../../hooks/use-fetch'; -import { TendermintTransactionResponse } from '../tendermint-transaction-response.d'; -import { ChainExplorerTxResponse } from '../../types/chain-explorer-response'; +import type { TendermintTransactionResponse } from '../tendermint-transaction-response.d'; +import type { ChainExplorerTxResponse } from '../../types/chain-explorer-response'; import { DATA_SOURCES } from '../../../config'; import { RouteTitle } from '../../../components/route-title'; import { RenderFetched } from '../../../components/render-fetched'; diff --git a/apps/explorer/src/app/routes/txs/id/tx-content.tsx b/apps/explorer/src/app/routes/txs/id/tx-content.tsx index 8d334080c..a5a194740 100644 --- a/apps/explorer/src/app/routes/txs/id/tx-content.tsx +++ b/apps/explorer/src/app/routes/txs/id/tx-content.tsx @@ -7,7 +7,7 @@ import { TableRow, } from '../../../components/table'; import { TxOrderType } from '../../../components/txs'; -import { ChainExplorerTxResponse } from '../../../routes/types/chain-explorer-response'; +import type { ChainExplorerTxResponse } from '../../../routes/types/chain-explorer-response'; interface TxContentProps { data: ChainExplorerTxResponse | undefined; diff --git a/apps/explorer/src/app/routes/txs/id/tx-details.tsx b/apps/explorer/src/app/routes/txs/id/tx-details.tsx index 6e3f8e6b8..497d4efa1 100644 --- a/apps/explorer/src/app/routes/txs/id/tx-details.tsx +++ b/apps/explorer/src/app/routes/txs/id/tx-details.tsx @@ -7,7 +7,7 @@ import { } from '../../../components/table'; import { TruncateInline } from '../../../components/truncate/truncate'; import { Routes } from '../../../routes/router-config'; -import { Result } from '../../../routes/txs/tendermint-transaction-response.d'; +import type { Result } from '../../../routes/txs/tendermint-transaction-response.d'; interface TxDetailsProps { txData: Result | undefined; diff --git a/apps/explorer/src/app/routes/validators/index.tsx b/apps/explorer/src/app/routes/validators/index.tsx index ffb93d1fa..521b83bbc 100644 --- a/apps/explorer/src/app/routes/validators/index.tsx +++ b/apps/explorer/src/app/routes/validators/index.tsx @@ -5,8 +5,8 @@ import { SubHeading } from '../../components/sub-heading'; import { SyntaxHighlighter } from '../../components/syntax-highlighter'; import { DATA_SOURCES } from '../../config'; import useFetch from '../../hooks/use-fetch'; -import { TendermintValidatorsResponse } from './tendermint-validator-response'; -import { NodesQuery } from './__generated__/NodesQuery'; +import type { TendermintValidatorsResponse } from './tendermint-validator-response'; +import type { NodesQuery } from './__generated__/NodesQuery'; const NODES_QUERY = gql` query NodesQuery { diff --git a/apps/stats/src/report-web-vitals.ts b/apps/stats/src/report-web-vitals.ts index 49a2a16e0..6071e230d 100644 --- a/apps/stats/src/report-web-vitals.ts +++ b/apps/stats/src/report-web-vitals.ts @@ -1,4 +1,4 @@ -import { ReportHandler } from 'web-vitals'; +import type { ReportHandler } from 'web-vitals'; const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry && onPerfEntry instanceof Function) { diff --git a/apps/trading/components/app-loader/index.tsx b/apps/trading/components/app-loader/index.tsx index cb6f2d013..daf3ca871 100644 --- a/apps/trading/components/app-loader/index.tsx +++ b/apps/trading/components/app-loader/index.tsx @@ -1,5 +1,5 @@ import { useEagerConnect } from '../../hooks/use-vega-wallet-eager-connect'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; interface AppLoaderProps { children: ReactNode; diff --git a/apps/trading/components/page-query-container/index.tsx b/apps/trading/components/page-query-container/index.tsx index 360262604..44c3a3ed7 100644 --- a/apps/trading/components/page-query-container/index.tsx +++ b/apps/trading/components/page-query-container/index.tsx @@ -1,6 +1,7 @@ -import { OperationVariables, QueryHookOptions, useQuery } from '@apollo/client'; -import { DocumentNode } from 'graphql'; -import { ReactNode } from 'react'; +import type { OperationVariables, QueryHookOptions } from '@apollo/client'; +import { useQuery } from '@apollo/client'; +import type { DocumentNode } from 'graphql'; +import type { ReactNode } from 'react'; import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; interface PageQueryContainerProps { diff --git a/apps/trading/components/web3-container/web3-container.tsx b/apps/trading/components/web3-container/web3-container.tsx index 2241bc953..e2a48380d 100644 --- a/apps/trading/components/web3-container/web3-container.tsx +++ b/apps/trading/components/web3-container/web3-container.tsx @@ -1,7 +1,8 @@ import { Button, Splash } from '@vegaprotocol/ui-toolkit'; import { Web3Provider, Web3ConnectDialog } from '@vegaprotocol/web3'; import { useWeb3React } from '@web3-react/core'; -import { ReactNode, useEffect, useState } from 'react'; +import type { ReactNode } from 'react'; +import { useEffect, useState } from 'react'; import { Connectors } from '../../lib/web3-connectors'; interface Web3ContainerProps { diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index d5b1a8668..ae37cdfef 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -1,4 +1,4 @@ -import { AppProps } from 'next/app'; +import type { AppProps } from 'next/app'; import Head from 'next/head'; import { Navbar } from '../components/navbar'; import { ThemeContext } from '@vegaprotocol/react-helpers'; diff --git a/apps/trading/pages/markets/[marketId].page.tsx b/apps/trading/pages/markets/[marketId].page.tsx index 3fc398def..dfd37f869 100644 --- a/apps/trading/pages/markets/[marketId].page.tsx +++ b/apps/trading/pages/markets/[marketId].page.tsx @@ -1,5 +1,5 @@ import { gql } from '@apollo/client'; -import { Market, MarketVariables } from './__generated__/Market'; +import type { Market, MarketVariables } from './__generated__/Market'; import { Splash } from '@vegaprotocol/ui-toolkit'; import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; diff --git a/apps/trading/pages/markets/grid-tabs.tsx b/apps/trading/pages/markets/grid-tabs.tsx index ecab02260..5d7a248fc 100644 --- a/apps/trading/pages/markets/grid-tabs.tsx +++ b/apps/trading/pages/markets/grid-tabs.tsx @@ -1,14 +1,8 @@ import * as Tabs from '@radix-ui/react-tabs'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import { - Children, - isValidElement, - ReactElement, - ReactNode, - useEffect, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import { Children, isValidElement, useEffect, useState } from 'react'; interface GridTabsProps { children: ReactElement[]; diff --git a/apps/trading/pages/markets/trade-grid.tsx b/apps/trading/pages/markets/trade-grid.tsx index a42059118..ce600e8b6 100644 --- a/apps/trading/pages/markets/trade-grid.tsx +++ b/apps/trading/pages/markets/trade-grid.tsx @@ -1,12 +1,13 @@ import classNames from 'classnames'; import AutoSizer from 'react-virtualized-auto-sizer'; -import { useState, ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import { useState } from 'react'; import { GridTab, GridTabs } from './grid-tabs'; import { DealTicketContainer } from '@vegaprotocol/deal-ticket'; import { OrderListContainer } from '@vegaprotocol/order-list'; import { Splash } from '@vegaprotocol/ui-toolkit'; import { PositionsContainer } from '@vegaprotocol/positions'; -import { Market_market } from './__generated__/Market'; +import type { Market_market } from './__generated__/Market'; const Chart = () => ( diff --git a/libs/deal-ticket/src/deal-ticket-container.tsx b/libs/deal-ticket/src/deal-ticket-container.tsx index 8715f5406..359f99da5 100644 --- a/libs/deal-ticket/src/deal-ticket-container.tsx +++ b/libs/deal-ticket/src/deal-ticket-container.tsx @@ -1,7 +1,7 @@ import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit'; import { gql, useQuery } from '@apollo/client'; import { DealTicketManager } from './deal-ticket-manager'; -import { DealTicketQuery } from './__generated__/DealTicketQuery'; +import type { DealTicketQuery } from './__generated__/DealTicketQuery'; const DEAL_TICKET_QUERY = gql` query DealTicketQuery($marketId: ID!) { diff --git a/libs/deal-ticket/src/deal-ticket-limit.tsx b/libs/deal-ticket/src/deal-ticket-limit.tsx index 92df74775..a8fa08443 100644 --- a/libs/deal-ticket/src/deal-ticket-limit.tsx +++ b/libs/deal-ticket/src/deal-ticket-limit.tsx @@ -1,13 +1,13 @@ import { FormGroup, Input } from '@vegaprotocol/ui-toolkit'; import { OrderTimeInForce } from '@vegaprotocol/wallet'; -import { TransactionStatus } from './deal-ticket'; +import type { TransactionStatus } from './deal-ticket'; import { ExpirySelector } from './expiry-selector'; import { SideSelector } from './side-selector'; import { SubmitButton } from './submit-button'; import { TimeInForceSelector } from './time-in-force-selector'; import { TypeSelector } from './type-selector'; -import { Order } from './use-order-state'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { Order } from './use-order-state'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; interface DealTicketLimitProps { order: Order; diff --git a/libs/deal-ticket/src/deal-ticket-manager.tsx b/libs/deal-ticket/src/deal-ticket-manager.tsx index 837cb15ce..c7cc976f6 100644 --- a/libs/deal-ticket/src/deal-ticket-manager.tsx +++ b/libs/deal-ticket/src/deal-ticket-manager.tsx @@ -5,7 +5,7 @@ import { VegaTxStatus } from '@vegaprotocol/wallet'; import { DealTicket } from './deal-ticket'; import { useOrderSubmit } from './use-order-submit'; import { OrderDialog } from './order-dialog'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; interface DealTicketManagerProps { market: DealTicketQuery_market; diff --git a/libs/deal-ticket/src/deal-ticket-market.tsx b/libs/deal-ticket/src/deal-ticket-market.tsx index 3c1d11584..2caac612e 100644 --- a/libs/deal-ticket/src/deal-ticket-market.tsx +++ b/libs/deal-ticket/src/deal-ticket-market.tsx @@ -1,12 +1,12 @@ import { addDecimal } from '@vegaprotocol/react-helpers'; import { FormGroup, Input } from '@vegaprotocol/ui-toolkit'; -import { TransactionStatus } from './deal-ticket'; +import type { TransactionStatus } from './deal-ticket'; import { SideSelector } from './side-selector'; import { SubmitButton } from './submit-button'; import { TimeInForceSelector } from './time-in-force-selector'; import { TypeSelector } from './type-selector'; -import { Order } from './use-order-state'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { Order } from './use-order-state'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; interface DealTicketMarketProps { order: Order; diff --git a/libs/deal-ticket/src/deal-ticket.spec.tsx b/libs/deal-ticket/src/deal-ticket.spec.tsx index 9bd9c76c3..902e9e80e 100644 --- a/libs/deal-ticket/src/deal-ticket.spec.tsx +++ b/libs/deal-ticket/src/deal-ticket.spec.tsx @@ -7,8 +7,8 @@ import { import { addDecimal } from '@vegaprotocol/react-helpers'; import { fireEvent, render, screen } from '@testing-library/react'; import { DealTicket } from './deal-ticket'; -import { Order } from './use-order-state'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { Order } from './use-order-state'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; import { MarketState, MarketTradingMode } from '@vegaprotocol/types'; const order: Order = { diff --git a/libs/deal-ticket/src/deal-ticket.tsx b/libs/deal-ticket/src/deal-ticket.tsx index ceeb28ca2..52e32fd0a 100644 --- a/libs/deal-ticket/src/deal-ticket.tsx +++ b/libs/deal-ticket/src/deal-ticket.tsx @@ -1,9 +1,10 @@ -import { FormEvent } from 'react'; +import type { FormEvent } from 'react'; import { OrderSide, OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; -import { Order, useOrderState } from './use-order-state'; +import type { Order } from './use-order-state'; +import { useOrderState } from './use-order-state'; import { DealTicketMarket } from './deal-ticket-market'; import { DealTicketLimit } from './deal-ticket-limit'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; const DEFAULT_ORDER: Order = { type: OrderType.Market, diff --git a/libs/deal-ticket/src/expiry-selector.tsx b/libs/deal-ticket/src/expiry-selector.tsx index 01f01243d..cdb745a63 100644 --- a/libs/deal-ticket/src/expiry-selector.tsx +++ b/libs/deal-ticket/src/expiry-selector.tsx @@ -1,5 +1,5 @@ import { FormGroup, Input } from '@vegaprotocol/ui-toolkit'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; import { formatForInput } from '@vegaprotocol/react-helpers'; interface ExpirySelectorProps { diff --git a/libs/deal-ticket/src/order-dialog.tsx b/libs/deal-ticket/src/order-dialog.tsx index 950ec4162..aaa9e75a6 100644 --- a/libs/deal-ticket/src/order-dialog.tsx +++ b/libs/deal-ticket/src/order-dialog.tsx @@ -1,8 +1,9 @@ import { Icon, Loader } from '@vegaprotocol/ui-toolkit'; -import { ReactNode } from 'react'; -import { OrderEvent_busEvents_event_Order } from './__generated__/OrderEvent'; +import type { ReactNode } from 'react'; +import type { OrderEvent_busEvents_event_Order } from './__generated__/OrderEvent'; import { formatNumber } from '@vegaprotocol/react-helpers'; -import { TransactionState, VegaTxStatus } from '@vegaprotocol/wallet'; +import type { TransactionState } from '@vegaprotocol/wallet'; +import { VegaTxStatus } from '@vegaprotocol/wallet'; interface OrderDialogProps { transaction: TransactionState; diff --git a/libs/deal-ticket/src/side-selector.tsx b/libs/deal-ticket/src/side-selector.tsx index 029ea318a..ef891cd3c 100644 --- a/libs/deal-ticket/src/side-selector.tsx +++ b/libs/deal-ticket/src/side-selector.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@vegaprotocol/ui-toolkit'; import { OrderSide } from '@vegaprotocol/wallet'; import { ButtonRadio } from './button-radio'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; interface SideSelectorProps { order: Order; diff --git a/libs/deal-ticket/src/submit-button.tsx b/libs/deal-ticket/src/submit-button.tsx index 6359a9f48..83bfb90f6 100644 --- a/libs/deal-ticket/src/submit-button.tsx +++ b/libs/deal-ticket/src/submit-button.tsx @@ -1,10 +1,10 @@ import { Button, InputError } from '@vegaprotocol/ui-toolkit'; import { OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; import { useMemo } from 'react'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; import { useVegaWallet } from '@vegaprotocol/wallet'; -import { TransactionStatus } from './deal-ticket'; -import { DealTicketQuery_market } from './__generated__/DealTicketQuery'; +import type { TransactionStatus } from './deal-ticket'; +import type { DealTicketQuery_market } from './__generated__/DealTicketQuery'; import { MarketState, MarketTradingMode } from '@vegaprotocol/types'; interface SubmitButtonProps { diff --git a/libs/deal-ticket/src/time-in-force-selector.tsx b/libs/deal-ticket/src/time-in-force-selector.tsx index 6c793ea46..abea9a766 100644 --- a/libs/deal-ticket/src/time-in-force-selector.tsx +++ b/libs/deal-ticket/src/time-in-force-selector.tsx @@ -1,6 +1,6 @@ import { FormGroup, Select } from '@vegaprotocol/ui-toolkit'; import { OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; interface TimeInForceSelectorProps { order: Order; diff --git a/libs/deal-ticket/src/type-selector.tsx b/libs/deal-ticket/src/type-selector.tsx index b3621843a..a39ee2c57 100644 --- a/libs/deal-ticket/src/type-selector.tsx +++ b/libs/deal-ticket/src/type-selector.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@vegaprotocol/ui-toolkit'; import { OrderType } from '@vegaprotocol/wallet'; import { ButtonRadio } from './button-radio'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; interface TypeSelectorProps { order: Order; diff --git a/libs/deal-ticket/src/use-order-state.ts b/libs/deal-ticket/src/use-order-state.ts index 42545ce01..787725ade 100644 --- a/libs/deal-ticket/src/use-order-state.ts +++ b/libs/deal-ticket/src/use-order-state.ts @@ -1,4 +1,5 @@ -import { OrderSide, OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; +import type { OrderSide } from '@vegaprotocol/wallet'; +import { OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; import { useState, useCallback } from 'react'; export interface Order { diff --git a/libs/deal-ticket/src/use-order-submit.spec.tsx b/libs/deal-ticket/src/use-order-submit.spec.tsx index e89d78607..2f50a0a30 100644 --- a/libs/deal-ticket/src/use-order-submit.spec.tsx +++ b/libs/deal-ticket/src/use-order-submit.spec.tsx @@ -1,14 +1,13 @@ import { MockedProvider } from '@apollo/client/testing'; import { act, renderHook } from '@testing-library/react-hooks'; -import { Order } from './use-order-state'; -import { +import type { Order } from './use-order-state'; +import type { VegaKeyExtended, - VegaTxStatus, - VegaWalletContext, VegaWalletContextShape, } from '@vegaprotocol/wallet'; +import { VegaTxStatus, VegaWalletContext } from '@vegaprotocol/wallet'; import { OrderSide, OrderTimeInForce, OrderType } from '@vegaprotocol/wallet'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { useOrderSubmit } from './use-order-submit'; const defaultWalletContext = { diff --git a/libs/deal-ticket/src/use-order-submit.ts b/libs/deal-ticket/src/use-order-submit.ts index 4392ab024..fae8e81d2 100644 --- a/libs/deal-ticket/src/use-order-submit.ts +++ b/libs/deal-ticket/src/use-order-submit.ts @@ -2,11 +2,11 @@ import { useCallback, useEffect, useState } from 'react'; import { gql, useSubscription } from '@apollo/client'; import { ethers } from 'ethers'; import { SHA3 } from 'sha3'; -import { Order } from './use-order-state'; +import type { Order } from './use-order-state'; import { OrderType, useVegaWallet } from '@vegaprotocol/wallet'; import { removeDecimal } from '@vegaprotocol/react-helpers'; import { useVegaTransaction } from '@vegaprotocol/wallet'; -import { +import type { OrderEvent, OrderEventVariables, OrderEvent_busEvents_event_Order, diff --git a/libs/market-list/src/lib/market-list-table.tsx b/libs/market-list/src/lib/market-list-table.tsx index 8b58d21eb..1c537d0d6 100644 --- a/libs/market-list/src/lib/market-list-table.tsx +++ b/libs/market-list/src/lib/market-list-table.tsx @@ -2,7 +2,7 @@ import { forwardRef } from 'react'; import type { ValueFormatterParams } from 'ag-grid-community'; import { PriceCell, formatNumber } from '@vegaprotocol/react-helpers'; import { AgGridDynamic as AgGrid } from '@vegaprotocol/ui-toolkit'; -import { Markets_markets } from './__generated__/Markets'; +import type { Markets_markets } from './__generated__/Markets'; import { AgGridColumn } from 'ag-grid-react'; import type { AgGridReact } from 'ag-grid-react'; diff --git a/libs/market-list/src/lib/markets-container.tsx b/libs/market-list/src/lib/markets-container.tsx index b4813ccce..ee5cd20e5 100644 --- a/libs/market-list/src/lib/markets-container.tsx +++ b/libs/market-list/src/lib/markets-container.tsx @@ -6,7 +6,10 @@ import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; import { MarketListTable, getRowNodeId } from './market-list-table'; import { useDataProvider } from '@vegaprotocol/react-helpers'; import type { AgGridReact } from 'ag-grid-react'; -import { Markets_markets, Markets_markets_data } from './__generated__/Markets'; +import type { + Markets_markets, + Markets_markets_data, +} from './__generated__/Markets'; import { marketsDataProvider } from './markets-data-provider'; export const MarketsContainer = () => { diff --git a/libs/market-list/src/lib/markets-data-provider.ts b/libs/market-list/src/lib/markets-data-provider.ts index 67f6fffc6..6ee73e94f 100644 --- a/libs/market-list/src/lib/markets-data-provider.ts +++ b/libs/market-list/src/lib/markets-data-provider.ts @@ -1,8 +1,8 @@ import { gql } from '@apollo/client'; -import { Markets, Markets_markets } from './__generated__/Markets'; +import type { Markets, Markets_markets } from './__generated__/Markets'; import { makeDataProvider } from '@vegaprotocol/react-helpers'; -import { +import type { MarketDataSub, MarketDataSub_marketData, } from './__generated__/MarketDataSub'; diff --git a/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx b/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx index 4844e7955..0e7d517c2 100644 --- a/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx +++ b/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx @@ -1,4 +1,4 @@ -import { value, goodThreshold } from '../../config/types'; +import type { value, goodThreshold } from '../../config/types'; interface GoodThresholdIndicatorProps { goodThreshold: goodThreshold | undefined; diff --git a/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx b/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx index 0b6f9e4f5..ec47ac010 100644 --- a/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx +++ b/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx @@ -1,5 +1,5 @@ import { Tooltip } from '../tooltip'; -import { StatFields } from '../../config/types'; +import type { StatFields } from '../../config/types'; import { defaultFieldFormatter } from '../table-row'; import { GoodThresholdIndicator } from '../good-threshold-indicator'; diff --git a/libs/network-stats/src/components/stats-manager/stats-manager.tsx b/libs/network-stats/src/components/stats-manager/stats-manager.tsx index c7b3a1e40..302503e98 100644 --- a/libs/network-stats/src/components/stats-manager/stats-manager.tsx +++ b/libs/network-stats/src/components/stats-manager/stats-manager.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import classnames from 'classnames'; import { statsFields } from '../../config/stats-fields'; -import { +import type { Stats as IStats, StructuredStats as IStructuredStats, } from '../../config/types'; diff --git a/libs/network-stats/src/components/table-row/table-row.tsx b/libs/network-stats/src/components/table-row/table-row.tsx index 4a6403ab5..b43296596 100644 --- a/libs/network-stats/src/components/table-row/table-row.tsx +++ b/libs/network-stats/src/components/table-row/table-row.tsx @@ -1,5 +1,5 @@ import { Tooltip } from '../tooltip'; -import { StatFields } from '../../config/types'; +import type { StatFields } from '../../config/types'; import { GoodThresholdIndicator } from '../good-threshold-indicator'; export const defaultFieldFormatter = (field: unknown) => diff --git a/libs/network-stats/src/config/stats-fields.ts b/libs/network-stats/src/config/stats-fields.ts index c779c1c39..8a10a5430 100644 --- a/libs/network-stats/src/config/stats-fields.ts +++ b/libs/network-stats/src/config/stats-fields.ts @@ -1,4 +1,4 @@ -import { Stats as IStats, StatFields as IStatFields } from './types'; +import type { Stats as IStats, StatFields as IStatFields } from './types'; // Stats fields config. Keys will correspond to graphql queries when used, and values // contain the associated data and methods we need to render. A single query diff --git a/libs/order-list/src/order-list-manager.spec.tsx b/libs/order-list/src/order-list-manager.spec.tsx index 2be69170e..70bd19a7b 100644 --- a/libs/order-list/src/order-list-manager.spec.tsx +++ b/libs/order-list/src/order-list-manager.spec.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { OrderListManager } from './order-list-manager'; import * as useOrdersHook from './use-orders'; -import { Orders_party_orders } from './__generated__/Orders'; +import type { Orders_party_orders } from './__generated__/Orders'; jest.mock('./order-list', () => ({ OrderList: () =>
OrderList
, diff --git a/libs/order-list/src/order-list-manager.tsx b/libs/order-list/src/order-list-manager.tsx index ceb262614..7a2b13915 100644 --- a/libs/order-list/src/order-list-manager.tsx +++ b/libs/order-list/src/order-list-manager.tsx @@ -1,7 +1,7 @@ import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; import { useOrders } from './use-orders'; import { OrderList } from './order-list'; -import { OrderFields } from './__generated__/OrderFields'; +import type { OrderFields } from './__generated__/OrderFields'; interface OrderListManagerProps { partyId: string; diff --git a/libs/order-list/src/order-list.spec.tsx b/libs/order-list/src/order-list.spec.tsx index 8dc9e57dc..40b3e23f6 100644 --- a/libs/order-list/src/order-list.spec.tsx +++ b/libs/order-list/src/order-list.spec.tsx @@ -1,6 +1,6 @@ import { act, render, screen } from '@testing-library/react'; import { formatNumber, getDateTimeFormat } from '@vegaprotocol/react-helpers'; -import { Orders_party_orders } from './__generated__/Orders'; +import type { Orders_party_orders } from './__generated__/Orders'; import { OrderStatus, OrderTimeInForce, diff --git a/libs/order-list/src/order-list.tsx b/libs/order-list/src/order-list.tsx index 6ea026ca9..b1b0ada31 100644 --- a/libs/order-list/src/order-list.tsx +++ b/libs/order-list/src/order-list.tsx @@ -1,12 +1,12 @@ import { OrderTimeInForce, OrderStatus, Side } from '@vegaprotocol/types'; -import { Orders_party_orders } from './__generated__/Orders'; +import type { Orders_party_orders } from './__generated__/Orders'; import { formatNumber, getDateTimeFormat, useApplyGridTransaction, } from '@vegaprotocol/react-helpers'; import { AgGridDynamic as AgGrid } from '@vegaprotocol/ui-toolkit'; -import { GridApi, ValueFormatterParams } from 'ag-grid-community'; +import type { GridApi, ValueFormatterParams } from 'ag-grid-community'; import { AgGridColumn } from 'ag-grid-react'; import { useRef, useState } from 'react'; diff --git a/libs/order-list/src/use-orders.spec.tsx b/libs/order-list/src/use-orders.spec.tsx index 50b9cccbe..1e7b9dfef 100644 --- a/libs/order-list/src/use-orders.spec.tsx +++ b/libs/order-list/src/use-orders.spec.tsx @@ -1,8 +1,9 @@ -import { MockedProvider, MockedResponse } from '@apollo/client/testing'; +import type { MockedResponse } from '@apollo/client/testing'; +import { MockedProvider } from '@apollo/client/testing'; import { renderHook } from '@testing-library/react-hooks'; -import { OrderFields } from './__generated__/OrderFields'; -import { Orders } from './__generated__/Orders'; -import { OrderSub } from './__generated__/OrderSub'; +import type { OrderFields } from './__generated__/OrderFields'; +import type { Orders } from './__generated__/Orders'; +import type { OrderSub } from './__generated__/OrderSub'; import { OrderStatus, Side, @@ -10,7 +11,7 @@ import { OrderTimeInForce, } from '@vegaprotocol/types'; import {} from '@vegaprotocol/wallet'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { ORDERS_QUERY, ORDERS_SUB, useOrders } from './use-orders'; const partyId = '0x123'; diff --git a/libs/order-list/src/use-orders.ts b/libs/order-list/src/use-orders.ts index 8954b02d4..d9c40f953 100644 --- a/libs/order-list/src/use-orders.ts +++ b/libs/order-list/src/use-orders.ts @@ -2,9 +2,9 @@ import { useCallback, useEffect, useState } from 'react'; import { gql, useApolloClient } from '@apollo/client'; import uniqBy from 'lodash/uniqBy'; import orderBy from 'lodash/orderBy'; -import { Orders, OrdersVariables } from './__generated__/Orders'; -import { OrderSub, OrderSubVariables } from './__generated__/OrderSub'; -import { OrderFields } from './__generated__/OrderFields'; +import type { Orders, OrdersVariables } from './__generated__/Orders'; +import type { OrderSub, OrderSubVariables } from './__generated__/OrderSub'; +import type { OrderFields } from './__generated__/OrderFields'; const ORDER_FRAGMENT = gql` fragment OrderFields on Order { diff --git a/libs/positions/src/lib/positions-data-provider.ts b/libs/positions/src/lib/positions-data-provider.ts index 74281dc4e..d1d26a602 100644 --- a/libs/positions/src/lib/positions-data-provider.ts +++ b/libs/positions/src/lib/positions-data-provider.ts @@ -1,11 +1,11 @@ import { gql } from '@apollo/client'; -import { +import type { Positions, Positions_party_positions, } from './__generated__/Positions'; import { makeDataProvider } from '@vegaprotocol/react-helpers'; -import { +import type { PositionSubscribe, PositionSubscribe_positions, } from './__generated__/PositionSubscribe'; diff --git a/libs/positions/src/lib/positions-manager.tsx b/libs/positions/src/lib/positions-manager.tsx index 28b790a1f..5f299d981 100644 --- a/libs/positions/src/lib/positions-manager.tsx +++ b/libs/positions/src/lib/positions-manager.tsx @@ -3,8 +3,8 @@ import { produce } from 'immer'; import merge from 'lodash/merge'; import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; import { useDataProvider } from '@vegaprotocol/react-helpers'; -import { PositionSubscribe_positions } from './__generated__/PositionSubscribe'; -import { Positions_party_positions } from './__generated__/Positions'; +import type { PositionSubscribe_positions } from './__generated__/PositionSubscribe'; +import type { Positions_party_positions } from './__generated__/Positions'; import type { AgGridReact } from 'ag-grid-react'; import PositionsTable, { getRowNodeId } from './positions-table'; diff --git a/libs/positions/src/lib/positions-table.spec.tsx b/libs/positions/src/lib/positions-table.spec.tsx index e6a4c426e..8efdf8f24 100644 --- a/libs/positions/src/lib/positions-table.spec.tsx +++ b/libs/positions/src/lib/positions-table.spec.tsx @@ -1,6 +1,6 @@ import { act, render, screen } from '@testing-library/react'; import PositionsTable from './positions-table'; -import { Positions_party_positions } from './__generated__/Positions'; +import type { Positions_party_positions } from './__generated__/Positions'; import { MarketTradingMode } from '@vegaprotocol/types'; const singleRow: Positions_party_positions = { diff --git a/libs/positions/src/lib/positions-table.tsx b/libs/positions/src/lib/positions-table.tsx index ebe695648..01e2cad8a 100644 --- a/libs/positions/src/lib/positions-table.tsx +++ b/libs/positions/src/lib/positions-table.tsx @@ -10,7 +10,7 @@ import { AgGridDynamic as AgGrid } from '@vegaprotocol/ui-toolkit'; import { AgGridColumn } from 'ag-grid-react'; import type { AgGridReact } from 'ag-grid-react'; import compact from 'lodash/compact'; -import { Positions_party_positions } from './__generated__/Positions'; +import type { Positions_party_positions } from './__generated__/Positions'; import { MarketTradingMode } from '@vegaprotocol/types'; interface PositionsTableProps { diff --git a/libs/react-helpers/src/hooks/use-apply-grid-transaction.ts b/libs/react-helpers/src/hooks/use-apply-grid-transaction.ts index 007f891a7..7a41813d2 100644 --- a/libs/react-helpers/src/hooks/use-apply-grid-transaction.ts +++ b/libs/react-helpers/src/hooks/use-apply-grid-transaction.ts @@ -1,4 +1,4 @@ -import { GridApi } from 'ag-grid-community'; +import type { GridApi } from 'ag-grid-community'; import { useEffect } from 'react'; import isEqual from 'lodash/isEqual'; diff --git a/libs/react-helpers/src/lib/grid-cells/flash-cell.stories.tsx b/libs/react-helpers/src/lib/grid-cells/flash-cell.stories.tsx index 6530aae60..c0fc5dedb 100644 --- a/libs/react-helpers/src/lib/grid-cells/flash-cell.stories.tsx +++ b/libs/react-helpers/src/lib/grid-cells/flash-cell.stories.tsx @@ -1,5 +1,5 @@ import { FlashCell } from './flash-cell'; -import { Meta, Story } from '@storybook/react'; +import type { Meta, Story } from '@storybook/react'; import * as React from 'react'; export default { diff --git a/libs/ui-toolkit/src/components/ag-grid/ag-grid-dark.tsx b/libs/ui-toolkit/src/components/ag-grid/ag-grid-dark.tsx index a0c0c9022..ebc0aeaf1 100644 --- a/libs/ui-toolkit/src/components/ag-grid/ag-grid-dark.tsx +++ b/libs/ui-toolkit/src/components/ag-grid/ag-grid-dark.tsx @@ -1,4 +1,4 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; import { theme } from '@vegaprotocol/tailwindcss-config'; import 'ag-grid-community/dist/styles/ag-theme-balham-dark.css'; diff --git a/libs/ui-toolkit/src/components/ag-grid/ag-grid-light.tsx b/libs/ui-toolkit/src/components/ag-grid/ag-grid-light.tsx index 90ed42eef..868d8fdb5 100644 --- a/libs/ui-toolkit/src/components/ag-grid/ag-grid-light.tsx +++ b/libs/ui-toolkit/src/components/ag-grid/ag-grid-light.tsx @@ -1,4 +1,4 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; import { theme } from '@vegaprotocol/tailwindcss-config'; import 'ag-grid-community/dist/styles/ag-theme-balham.css'; diff --git a/libs/ui-toolkit/src/components/async-renderer/async-renderer.tsx b/libs/ui-toolkit/src/components/async-renderer/async-renderer.tsx index 99dd1ec19..451b25354 100644 --- a/libs/ui-toolkit/src/components/async-renderer/async-renderer.tsx +++ b/libs/ui-toolkit/src/components/async-renderer/async-renderer.tsx @@ -1,5 +1,5 @@ import { Splash } from '../splash'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; interface AsyncRendererProps { loading: boolean; diff --git a/libs/ui-toolkit/src/components/button/button.stories.tsx b/libs/ui-toolkit/src/components/button/button.stories.tsx index f2161ca90..f2abf4dda 100644 --- a/libs/ui-toolkit/src/components/button/button.stories.tsx +++ b/libs/ui-toolkit/src/components/button/button.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Button } from './button'; export default { diff --git a/libs/ui-toolkit/src/components/button/button.tsx b/libs/ui-toolkit/src/components/button/button.tsx index 075f09aee..e071f20d2 100644 --- a/libs/ui-toolkit/src/components/button/button.tsx +++ b/libs/ui-toolkit/src/components/button/button.tsx @@ -1,6 +1,8 @@ -import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef } from 'react'; +import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react'; +import { forwardRef } from 'react'; import classNames from 'classnames'; -import { Icon, IconName } from '../icon'; +import type { IconName } from '../icon'; +import { Icon } from '../icon'; import { includesLeftPadding, includesRightPadding, diff --git a/libs/ui-toolkit/src/components/callout/callout.stories.tsx b/libs/ui-toolkit/src/components/callout/callout.stories.tsx index ad910f35e..94dacb3bb 100644 --- a/libs/ui-toolkit/src/components/callout/callout.stories.tsx +++ b/libs/ui-toolkit/src/components/callout/callout.stories.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStory, ComponentMeta } from '@storybook/react'; import { Callout } from './callout'; import { Button } from '../button'; diff --git a/libs/ui-toolkit/src/components/callout/callout.tsx b/libs/ui-toolkit/src/components/callout/callout.tsx index ef25176a0..999f0143b 100644 --- a/libs/ui-toolkit/src/components/callout/callout.tsx +++ b/libs/ui-toolkit/src/components/callout/callout.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; import { getIntentShadow, Intent } from '../../utils/intent'; -import { Icon, IconName } from '../icon'; +import type { IconName } from '../icon'; +import { Icon } from '../icon'; export interface CalloutProps { children?: React.ReactNode; diff --git a/libs/ui-toolkit/src/components/dialog/dialog.stories.tsx b/libs/ui-toolkit/src/components/dialog/dialog.stories.tsx index 97ec9cc31..4d3752813 100644 --- a/libs/ui-toolkit/src/components/dialog/dialog.stories.tsx +++ b/libs/ui-toolkit/src/components/dialog/dialog.stories.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStory, ComponentMeta } from '@storybook/react'; import { Dialog } from './dialog'; import { Button } from '../button'; diff --git a/libs/ui-toolkit/src/components/dialog/dialog.tsx b/libs/ui-toolkit/src/components/dialog/dialog.tsx index 79727c523..a6c81d936 100644 --- a/libs/ui-toolkit/src/components/dialog/dialog.tsx +++ b/libs/ui-toolkit/src/components/dialog/dialog.tsx @@ -1,7 +1,8 @@ import * as DialogPrimitives from '@radix-ui/react-dialog'; import classNames from 'classnames'; -import { ReactNode } from 'react'; -import { getIntentShadow, Intent } from '../../utils/intent'; +import type { ReactNode } from 'react'; +import type { Intent } from '../../utils/intent'; +import { getIntentShadow } from '../../utils/intent'; import { Icon } from '../icon'; interface DialogProps { diff --git a/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.stories.tsx b/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.stories.tsx index 0ab295604..6579117f6 100644 --- a/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.stories.tsx +++ b/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.stories.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import type { ComponentStory, ComponentMeta } from '@storybook/react'; import { EtherscanLink } from '.'; import { EthereumChainIds, EthereumChainNames } from '../../utils/web3'; diff --git a/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.tsx b/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.tsx index da08a8a8e..bd81014de 100644 --- a/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.tsx +++ b/libs/ui-toolkit/src/components/etherscan-link/etherscan-link.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { EthereumChainId } from '../../utils/web3'; +import type { EthereumChainId } from '../../utils/web3'; const etherscanUrls: Record = { '0x1': 'https://etherscan.io', diff --git a/libs/ui-toolkit/src/components/form-group/form-group.tsx b/libs/ui-toolkit/src/components/form-group/form-group.tsx index bd5724943..1adb35330 100644 --- a/libs/ui-toolkit/src/components/form-group/form-group.tsx +++ b/libs/ui-toolkit/src/components/form-group/form-group.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; interface FormGroupProps { children: ReactNode; diff --git a/libs/ui-toolkit/src/components/form-group/from-group.stories.tsx b/libs/ui-toolkit/src/components/form-group/from-group.stories.tsx index da5b18ad5..6348f9372 100644 --- a/libs/ui-toolkit/src/components/form-group/from-group.stories.tsx +++ b/libs/ui-toolkit/src/components/form-group/from-group.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Input } from '../input'; import { FormGroup } from './form-group'; export default { diff --git a/libs/ui-toolkit/src/components/icon/icon.stories.tsx b/libs/ui-toolkit/src/components/icon/icon.stories.tsx index 5fe951f90..8ab3ec65e 100644 --- a/libs/ui-toolkit/src/components/icon/icon.stories.tsx +++ b/libs/ui-toolkit/src/components/icon/icon.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Icon } from './icon'; export default { diff --git a/libs/ui-toolkit/src/components/icon/icon.tsx b/libs/ui-toolkit/src/components/icon/icon.tsx index 8ea0b4251..595e8f2c2 100644 --- a/libs/ui-toolkit/src/components/icon/icon.tsx +++ b/libs/ui-toolkit/src/components/icon/icon.tsx @@ -1,4 +1,5 @@ -import { IconSvgPaths20, IconSvgPaths16, IconName } from '@blueprintjs/icons'; +import type { IconName } from '@blueprintjs/icons'; +import { IconSvgPaths20, IconSvgPaths16 } from '@blueprintjs/icons'; import classNames from 'classnames'; export type { IconName } from '@blueprintjs/icons'; diff --git a/libs/ui-toolkit/src/components/input-error/input-error.stories.tsx b/libs/ui-toolkit/src/components/input-error/input-error.stories.tsx index b227a0c6c..2f46aa9b0 100644 --- a/libs/ui-toolkit/src/components/input-error/input-error.stories.tsx +++ b/libs/ui-toolkit/src/components/input-error/input-error.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { InputError } from './input-error'; export default { diff --git a/libs/ui-toolkit/src/components/input-error/input-error.tsx b/libs/ui-toolkit/src/components/input-error/input-error.tsx index 69e835b09..6f7837ae8 100644 --- a/libs/ui-toolkit/src/components/input-error/input-error.tsx +++ b/libs/ui-toolkit/src/components/input-error/input-error.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; import { Icon } from '../icon'; interface InputErrorProps extends HTMLAttributes { diff --git a/libs/ui-toolkit/src/components/input/input.stories.tsx b/libs/ui-toolkit/src/components/input/input.stories.tsx index 97ff3587d..85fd255e8 100644 --- a/libs/ui-toolkit/src/components/input/input.stories.tsx +++ b/libs/ui-toolkit/src/components/input/input.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Input } from './input'; export default { component: Input, diff --git a/libs/ui-toolkit/src/components/input/input.tsx b/libs/ui-toolkit/src/components/input/input.tsx index e58411858..905a12b43 100644 --- a/libs/ui-toolkit/src/components/input/input.tsx +++ b/libs/ui-toolkit/src/components/input/input.tsx @@ -1,6 +1,8 @@ -import { InputHTMLAttributes, forwardRef } from 'react'; +import type { InputHTMLAttributes } from 'react'; +import { forwardRef } from 'react'; import classNames from 'classnames'; -import { Icon, IconName } from '../icon'; +import type { IconName } from '../icon'; +import { Icon } from '../icon'; import { includesLeftPadding, includesRightPadding, diff --git a/libs/ui-toolkit/src/components/lozenge/lozenge.stories.tsx b/libs/ui-toolkit/src/components/lozenge/lozenge.stories.tsx index 6ceefccf6..cb065db53 100644 --- a/libs/ui-toolkit/src/components/lozenge/lozenge.stories.tsx +++ b/libs/ui-toolkit/src/components/lozenge/lozenge.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Lozenge } from './lozenge'; export default { diff --git a/libs/ui-toolkit/src/components/lozenge/lozenge.tsx b/libs/ui-toolkit/src/components/lozenge/lozenge.tsx index 19c44454e..54c3d25fa 100644 --- a/libs/ui-toolkit/src/components/lozenge/lozenge.tsx +++ b/libs/ui-toolkit/src/components/lozenge/lozenge.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import classNames from 'classnames'; interface LozengeProps { diff --git a/libs/ui-toolkit/src/components/select/select.stories.tsx b/libs/ui-toolkit/src/components/select/select.stories.tsx index f223cb9d3..713ab4043 100644 --- a/libs/ui-toolkit/src/components/select/select.stories.tsx +++ b/libs/ui-toolkit/src/components/select/select.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { Select } from './select'; export default { diff --git a/libs/ui-toolkit/src/components/select/select.tsx b/libs/ui-toolkit/src/components/select/select.tsx index 189b2e9c7..3f7b74b79 100644 --- a/libs/ui-toolkit/src/components/select/select.tsx +++ b/libs/ui-toolkit/src/components/select/select.tsx @@ -1,4 +1,5 @@ -import { SelectHTMLAttributes, forwardRef } from 'react'; +import type { SelectHTMLAttributes } from 'react'; +import { forwardRef } from 'react'; import classNames from 'classnames'; import { inputClassNames } from '../input/input'; diff --git a/libs/ui-toolkit/src/components/splash/splash.stories.tsx b/libs/ui-toolkit/src/components/splash/splash.stories.tsx index a1e9ec77c..6a956389c 100644 --- a/libs/ui-toolkit/src/components/splash/splash.stories.tsx +++ b/libs/ui-toolkit/src/components/splash/splash.stories.tsx @@ -1,5 +1,6 @@ -import { Story, ComponentMeta } from '@storybook/react'; -import { Splash, SplashProps } from './splash'; +import type { Story, ComponentMeta } from '@storybook/react'; +import type { SplashProps } from './splash'; +import { Splash } from './splash'; export default { component: Splash, diff --git a/libs/ui-toolkit/src/components/splash/splash.tsx b/libs/ui-toolkit/src/components/splash/splash.tsx index 671405d70..f86751d43 100644 --- a/libs/ui-toolkit/src/components/splash/splash.tsx +++ b/libs/ui-toolkit/src/components/splash/splash.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; export interface SplashProps { children: ReactNode; diff --git a/libs/ui-toolkit/src/components/text-area/text-area.stories.tsx b/libs/ui-toolkit/src/components/text-area/text-area.stories.tsx index 4793f108a..b54922ddf 100644 --- a/libs/ui-toolkit/src/components/text-area/text-area.stories.tsx +++ b/libs/ui-toolkit/src/components/text-area/text-area.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { TextArea } from './text-area'; export default { diff --git a/libs/ui-toolkit/src/components/text-area/text-area.tsx b/libs/ui-toolkit/src/components/text-area/text-area.tsx index 5653941ee..df4484df7 100644 --- a/libs/ui-toolkit/src/components/text-area/text-area.tsx +++ b/libs/ui-toolkit/src/components/text-area/text-area.tsx @@ -1,4 +1,5 @@ -import { TextareaHTMLAttributes, forwardRef } from 'react'; +import type { TextareaHTMLAttributes } from 'react'; +import { forwardRef } from 'react'; import { inputClassNames } from '../input/input'; export interface TextAreaProps diff --git a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.stories.tsx b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.stories.tsx index a3af971e5..09341844b 100644 --- a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.stories.tsx +++ b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { ThemeSwitcher } from './theme-switcher'; export default { diff --git a/libs/ui-toolkit/src/components/vega-logo/lozenge.stories.tsx b/libs/ui-toolkit/src/components/vega-logo/lozenge.stories.tsx index 4e03ab8ca..3e9490025 100644 --- a/libs/ui-toolkit/src/components/vega-logo/lozenge.stories.tsx +++ b/libs/ui-toolkit/src/components/vega-logo/lozenge.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { VegaLogo } from './vega-logo'; export default { diff --git a/libs/ui-toolkit/src/utils/contrast.stories.tsx b/libs/ui-toolkit/src/utils/contrast.stories.tsx index 4be7d682f..d8112c549 100644 --- a/libs/ui-toolkit/src/utils/contrast.stories.tsx +++ b/libs/ui-toolkit/src/utils/contrast.stories.tsx @@ -1,4 +1,4 @@ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; interface ContrastCheckerProps { backgrounds: string[]; diff --git a/libs/wallet/src/connect-dialog.test.tsx b/libs/wallet/src/connect-dialog.test.tsx index 668726f17..7c5d977ce 100644 --- a/libs/wallet/src/connect-dialog.test.tsx +++ b/libs/wallet/src/connect-dialog.test.tsx @@ -6,9 +6,10 @@ import { screen, waitFor, } from '@testing-library/react'; -import { VegaWalletContext, VegaWalletContextShape } from './context'; +import type { VegaWalletContextShape } from './context'; +import { VegaWalletContext } from './context'; import { VegaConnectDialog } from './connect-dialog'; -import { VegaConnectDialogProps } from '.'; +import type { VegaConnectDialogProps } from '.'; import { RestConnector } from './connectors'; let defaultProps: VegaConnectDialogProps; diff --git a/libs/wallet/src/connect-dialog.tsx b/libs/wallet/src/connect-dialog.tsx index f75a39057..57ad8fc63 100644 --- a/libs/wallet/src/connect-dialog.tsx +++ b/libs/wallet/src/connect-dialog.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react'; import { Dialog } from '@vegaprotocol/ui-toolkit'; -import { VegaConnector } from './connectors'; +import type { VegaConnector } from './connectors'; import { RestConnectorForm } from './rest-connector-form'; import { useEffect } from 'react'; import { RestConnector } from './connectors/rest-connector'; diff --git a/libs/wallet/src/connectors/index.ts b/libs/wallet/src/connectors/index.ts index aa738f25a..4d075d52d 100644 --- a/libs/wallet/src/connectors/index.ts +++ b/libs/wallet/src/connectors/index.ts @@ -1,4 +1,4 @@ -import { +import type { VegaKey, TransactionResponse, OrderSubmissionBody, diff --git a/libs/wallet/src/connectors/injected-connector.ts b/libs/wallet/src/connectors/injected-connector.ts index 75601b9d5..48fc4ab48 100644 --- a/libs/wallet/src/connectors/injected-connector.ts +++ b/libs/wallet/src/connectors/injected-connector.ts @@ -1,4 +1,4 @@ -import { VegaConnector } from '.'; +import type { VegaConnector } from '.'; /** * Dummy injected connector that we may use when browser wallet is implemented diff --git a/libs/wallet/src/connectors/rest-connector.ts b/libs/wallet/src/connectors/rest-connector.ts index 686d28535..42fb0c465 100644 --- a/libs/wallet/src/connectors/rest-connector.ts +++ b/libs/wallet/src/connectors/rest-connector.ts @@ -1,12 +1,14 @@ -import { - DefaultApi, - createConfiguration, +import type { Configuration, OrderSubmissionBody, } from '@vegaprotocol/vegawallet-service-api-client'; +import { + DefaultApi, + createConfiguration, +} from '@vegaprotocol/vegawallet-service-api-client'; import { LocalStorage } from '@vegaprotocol/react-helpers'; import { WALLET_CONFIG } from '../storage-keys'; -import { VegaConnector } from '.'; +import type { VegaConnector } from '.'; // Perhaps there should be a default ConnectorConfig that others can extend off. Do all connectors // need to use local storage, I don't think so... diff --git a/libs/wallet/src/context.ts b/libs/wallet/src/context.ts index 3f66df95f..8859b1e32 100644 --- a/libs/wallet/src/context.ts +++ b/libs/wallet/src/context.ts @@ -1,10 +1,10 @@ -import { +import type { VegaKey, TransactionResponse, } from '@vegaprotocol/vegawallet-service-api-client'; import { createContext } from 'react'; -import { VegaConnector } from './connectors'; -import { Transaction } from './types'; +import type { VegaConnector } from './connectors'; +import type { Transaction } from './types'; export type SendTxError = | { diff --git a/libs/wallet/src/provider.test.tsx b/libs/wallet/src/provider.test.tsx index 227ead99b..bb8de8806 100644 --- a/libs/wallet/src/provider.test.tsx +++ b/libs/wallet/src/provider.test.tsx @@ -1,6 +1,6 @@ import '@testing-library/jest-dom'; import { act, fireEvent, render, screen } from '@testing-library/react'; -import { VegaKey } from '@vegaprotocol/vegawallet-service-api-client'; +import type { VegaKey } from '@vegaprotocol/vegawallet-service-api-client'; import { RestConnector } from './connectors'; import { useVegaWallet } from './hooks'; import { VegaWalletProvider } from './provider'; diff --git a/libs/wallet/src/provider.tsx b/libs/wallet/src/provider.tsx index 9b8305e62..0fe2b2840 100644 --- a/libs/wallet/src/provider.tsx +++ b/libs/wallet/src/provider.tsx @@ -1,17 +1,11 @@ import { LocalStorage } from '@vegaprotocol/react-helpers'; -import { - ReactNode, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; -import { VegaKeyExtended, VegaWalletContextShape } from '.'; -import { VegaConnector } from './connectors'; +import type { ReactNode } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { VegaKeyExtended, VegaWalletContextShape } from '.'; +import type { VegaConnector } from './connectors'; import { VegaWalletContext } from './context'; import { WALLET_KEY } from './storage-keys'; -import { OrderSubmissionBody } from '@vegaprotocol/vegawallet-service-api-client'; +import type { OrderSubmissionBody } from '@vegaprotocol/vegawallet-service-api-client'; interface VegaWalletProviderProps { children: ReactNode; diff --git a/libs/wallet/src/rest-connector-form.tsx b/libs/wallet/src/rest-connector-form.tsx index f459e89e7..e0d220860 100644 --- a/libs/wallet/src/rest-connector-form.tsx +++ b/libs/wallet/src/rest-connector-form.tsx @@ -1,7 +1,7 @@ import { Button, FormGroup, Input, InputError } from '@vegaprotocol/ui-toolkit'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; -import { RestConnector } from '.'; +import type { RestConnector } from '.'; interface FormFields { wallet: string; diff --git a/libs/wallet/src/use-vega-transaction.spec.tsx b/libs/wallet/src/use-vega-transaction.spec.tsx index e563cd42c..8d798f991 100644 --- a/libs/wallet/src/use-vega-transaction.spec.tsx +++ b/libs/wallet/src/use-vega-transaction.spec.tsx @@ -1,8 +1,9 @@ import { act, renderHook } from '@testing-library/react-hooks'; -import { VegaWalletContext, VegaWalletContextShape } from './context'; -import { ReactNode } from 'react'; +import type { VegaWalletContextShape } from './context'; +import { VegaWalletContext } from './context'; +import type { ReactNode } from 'react'; import { useVegaTransaction, VegaTxStatus } from './use-vega-transaction'; -import { OrderSubmission } from './types'; +import type { OrderSubmission } from './types'; const defaultWalletContext = { keypair: null, diff --git a/libs/wallet/src/use-vega-transaction.ts b/libs/wallet/src/use-vega-transaction.ts index b30b188ac..131b50b17 100644 --- a/libs/wallet/src/use-vega-transaction.ts +++ b/libs/wallet/src/use-vega-transaction.ts @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react'; -import { Transaction } from './types'; +import type { Transaction } from './types'; import { useVegaWallet } from './hooks'; -import { SendTxError } from './context'; +import type { SendTxError } from './context'; export enum VegaTxStatus { Default = 'Default', diff --git a/libs/web3/src/lib/types.ts b/libs/web3/src/lib/types.ts index f0a54f765..5dd624e6c 100644 --- a/libs/web3/src/lib/types.ts +++ b/libs/web3/src/lib/types.ts @@ -1,6 +1,6 @@ -import { Web3ReactHooks } from '@web3-react/core'; -import { MetaMask } from '@web3-react/metamask'; -import { WalletConnect } from '@web3-react/walletconnect'; +import type { Web3ReactHooks } from '@web3-react/core'; +import type { MetaMask } from '@web3-react/metamask'; +import type { WalletConnect } from '@web3-react/walletconnect'; export type Connectors = { [name: string]: [Connector, Web3ReactHooks, object]; diff --git a/libs/web3/src/lib/web3-connect-dialog.tsx b/libs/web3/src/lib/web3-connect-dialog.tsx index de11df2d1..878d5c370 100644 --- a/libs/web3/src/lib/web3-connect-dialog.tsx +++ b/libs/web3/src/lib/web3-connect-dialog.tsx @@ -1,5 +1,5 @@ import { Dialog, Intent } from '@vegaprotocol/ui-toolkit'; -import { Connectors } from './types'; +import type { Connectors } from './types'; interface Web3ConnectDialogProps { dialogOpen: boolean; diff --git a/libs/web3/src/lib/web3-provider.tsx b/libs/web3/src/lib/web3-provider.tsx index e7c429f93..c4314fbd7 100644 --- a/libs/web3/src/lib/web3-provider.tsx +++ b/libs/web3/src/lib/web3-provider.tsx @@ -1,5 +1,5 @@ import { Web3ReactProvider } from '@web3-react/core'; -import { Connectors } from './types'; +import type { Connectors } from './types'; interface Web3ProviderProps { children: JSX.Element | JSX.Element[];