Enable @typescript-eslint/consistent-type-imports eslint rule
This commit is contained in:
parent
4f15851103
commit
7af0efa8d8
@ -48,6 +48,13 @@
|
||||
"ts-check": false,
|
||||
"minimumDescriptionLength": 10
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{
|
||||
"prefer": "type-imports",
|
||||
"disallowTypeAnnotations": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
16
.github/workflows/test.yml
vendored
16
.github/workflows/test.yml
vendored
@ -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
|
||||
|
@ -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';
|
||||
|
@ -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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HTMLInputTypeAttribute, SyntheticEvent } from 'react';
|
||||
import type { HTMLInputTypeAttribute, SyntheticEvent } from 'react';
|
||||
import { Input, Button } from '@vegaprotocol/ui-toolkit';
|
||||
|
||||
interface JumpToProps {
|
||||
|
@ -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<HTMLHeadingElement> {
|
||||
children: React.ReactNode;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import classnames from 'classnames';
|
||||
import { HTMLAttributes } from 'react';
|
||||
import type { HTMLAttributes } from 'react';
|
||||
|
||||
interface SubHeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
||||
children: React.ReactNode;
|
||||
|
@ -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<HTMLTableElement> {
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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`
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ReportHandler } from 'web-vitals';
|
||||
import type { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
|
@ -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;
|
||||
|
@ -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<TData, TVariables> {
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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<GridTabProps>[];
|
||||
|
@ -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 = () => (
|
||||
<Splash>
|
||||
|
@ -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!) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 = {
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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 = {
|
||||
|
@ -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,
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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 = () => {
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { value, goodThreshold } from '../../config/types';
|
||||
import type { value, goodThreshold } from '../../config/types';
|
||||
|
||||
interface GoodThresholdIndicatorProps {
|
||||
goodThreshold: goodThreshold | undefined;
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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) =>
|
||||
|
@ -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
|
||||
|
@ -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: () => <div>OrderList</div>,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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 = {
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Splash } from '../splash';
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
interface AsyncRendererProps<T> {
|
||||
loading: boolean;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { Button } from './button';
|
||||
|
||||
export default {
|
||||
|
@ -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,
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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 {
|
||||
|
@ -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';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { EthereumChainId } from '../../utils/web3';
|
||||
import type { EthereumChainId } from '../../utils/web3';
|
||||
|
||||
const etherscanUrls: Record<EthereumChainId, string> = {
|
||||
'0x1': 'https://etherscan.io',
|
||||
|
@ -1,5 +1,5 @@
|
||||
import classNames from 'classnames';
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
interface FormGroupProps {
|
||||
children: ReactNode;
|
||||
|
@ -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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { Icon } from './icon';
|
||||
|
||||
export default {
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { InputError } from './input-error';
|
||||
|
||||
export default {
|
||||
|
@ -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<HTMLDivElement> {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { Lozenge } from './lozenge';
|
||||
|
||||
export default {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
interface LozengeProps {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { Select } from './select';
|
||||
|
||||
export default {
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import classNames from 'classnames';
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export interface SplashProps {
|
||||
children: ReactNode;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { TextArea } from './text-area';
|
||||
|
||||
export default {
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { ThemeSwitcher } from './theme-switcher';
|
||||
|
||||
export default {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Story, Meta } from '@storybook/react';
|
||||
import type { Story, Meta } from '@storybook/react';
|
||||
import { VegaLogo } from './vega-logo';
|
||||
|
||||
export default {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user