mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
eslint default export (#2995)
* eslint default export * fix linter error
This commit is contained in:
@@ -3,6 +3,7 @@ import jsPlugin from '@eslint/js';
|
||||
import nextJsPlugin from '@next/eslint-plugin-next';
|
||||
import stylisticPlugin from '@stylistic/eslint-plugin';
|
||||
import reactQueryPlugin from '@tanstack/eslint-plugin-query';
|
||||
import consistentDefaultExportNamePlugin from 'eslint-plugin-consistent-default-export-name';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import importHelpersPlugin from 'eslint-plugin-import-helpers';
|
||||
import jestPlugin from 'eslint-plugin-jest';
|
||||
@@ -330,6 +331,23 @@ export default tseslint.config(
|
||||
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'consistent-default-export-name': consistentDefaultExportNamePlugin,
|
||||
},
|
||||
files: [
|
||||
'ui/**/[A-Z]*.tsx',
|
||||
],
|
||||
ignores: [
|
||||
'**/*.pw.*',
|
||||
'**/*.pwstory.*',
|
||||
'**/pages/**',
|
||||
],
|
||||
rules: {
|
||||
'consistent-default-export-name/default-export-match-filename': [ 'error', null ],
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'@stylistic': stylisticPlugin,
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
"dotenv-cli": "^6.0.0",
|
||||
"eslint": "9.14.0",
|
||||
"eslint-config-next": "15.0.3",
|
||||
"eslint-plugin-consistent-default-export-name": "^0.0.15",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-import-helpers": "2.0.1",
|
||||
"eslint-plugin-jest": "28.9.0",
|
||||
|
||||
@@ -17,7 +17,7 @@ import LatestTxsItemMobile from './LatestTxsItemMobile';
|
||||
|
||||
const zetachainFeature = config.features.zetachain;
|
||||
|
||||
const LatestTransactions = () => {
|
||||
const LatestTxs = () => {
|
||||
const isMobile = useIsMobile();
|
||||
const txsCount = isMobile ? 2 : 5;
|
||||
const { data, isPlaceholderData, isError } = useApiQuery('general:homepage_txs', {
|
||||
@@ -67,4 +67,4 @@ const LatestTransactions = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export default LatestTransactions;
|
||||
export default LatestTxs;
|
||||
|
||||
@@ -15,7 +15,7 @@ import LatestArbitrumDeposits from './latestDeposits/LatestArbitrumDeposits';
|
||||
const rollupFeature = config.features.rollup;
|
||||
const zetachainFeature = config.features.zetachain;
|
||||
|
||||
const TransactionsHome = () => {
|
||||
const Transactions = () => {
|
||||
const isAuth = useAuth();
|
||||
if ((rollupFeature.isEnabled && (rollupFeature.type === 'optimistic' || rollupFeature.type === 'arbitrum')) || isAuth || zetachainFeature.isEnabled) {
|
||||
const tabs = [
|
||||
@@ -51,4 +51,4 @@ const TransactionsHome = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TransactionsHome;
|
||||
export default Transactions;
|
||||
|
||||
@@ -5,7 +5,7 @@ import config from 'configs/app';
|
||||
import type { EventTypes, EventPayload } from 'lib/mixpanel/index';
|
||||
import type { PopoverContentProps } from 'toolkit/chakra/popover';
|
||||
import { PopoverBody, PopoverContent, PopoverRoot } from 'toolkit/chakra/popover';
|
||||
import { Rating } from 'toolkit/chakra/rating';
|
||||
import { Rating as RatingComponent } from 'toolkit/chakra/rating';
|
||||
import { Skeleton } from 'toolkit/chakra/skeleton';
|
||||
import useIsAuth from 'ui/snippets/auth/useIsAuth';
|
||||
|
||||
@@ -26,7 +26,7 @@ type Props = {
|
||||
popoverContentProps?: PopoverContentProps;
|
||||
};
|
||||
|
||||
const MarketplaceRating = ({
|
||||
const Rating = ({
|
||||
appId, rating, ratingsTotalCount, userRating,
|
||||
isLoading, fullView, source, popoverContentProps,
|
||||
}: Props) => {
|
||||
@@ -45,7 +45,7 @@ const MarketplaceRating = ({
|
||||
>
|
||||
{ fullView && (
|
||||
<>
|
||||
<Rating defaultValue={ Math.floor(rating || 0) } readOnly key={ rating }/>
|
||||
<RatingComponent defaultValue={ Math.floor(rating || 0) } readOnly key={ rating }/>
|
||||
{ rating && <Text fontSize="md" ml={ 2 }>{ rating }</Text> }
|
||||
{ ratingsTotalCount && <Text color="text.secondary" textStyle="md" ml={ 1 }>({ ratingsTotalCount })</Text> }
|
||||
</>
|
||||
@@ -74,4 +74,4 @@ const MarketplaceRating = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default MarketplaceRating;
|
||||
export default Rating;
|
||||
|
||||
@@ -17,7 +17,7 @@ import StickyPaginationWithText from 'ui/shared/StickyPaginationWithText';
|
||||
|
||||
const feature = config.features.beaconChain;
|
||||
|
||||
const Deposits = () => {
|
||||
const BeaconChainDeposits = () => {
|
||||
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
|
||||
resourceName: 'general:deposits',
|
||||
options: {
|
||||
@@ -95,4 +95,4 @@ const Deposits = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Deposits;
|
||||
export default BeaconChainDeposits;
|
||||
|
||||
@@ -19,7 +19,7 @@ import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainW
|
||||
|
||||
const feature = config.features.beaconChain;
|
||||
|
||||
const Withdrawals = () => {
|
||||
const BeaconChainWithdrawals = () => {
|
||||
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
|
||||
resourceName: 'general:withdrawals',
|
||||
options: {
|
||||
@@ -99,4 +99,4 @@ const Withdrawals = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Withdrawals;
|
||||
export default BeaconChainWithdrawals;
|
||||
|
||||
@@ -14,7 +14,7 @@ import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
||||
import StickyPaginationWithText from 'ui/shared/StickyPaginationWithText';
|
||||
|
||||
const L2Deposits = () => {
|
||||
const ShibariumDeposits = () => {
|
||||
const { data, isError, isPlaceholderData, pagination } = useQueryWithPages({
|
||||
resourceName: 'general:shibarium_deposits',
|
||||
options: {
|
||||
@@ -86,4 +86,4 @@ const L2Deposits = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default L2Deposits;
|
||||
export default ShibariumDeposits;
|
||||
|
||||
@@ -16,7 +16,7 @@ type Props = {
|
||||
bottomText?: string;
|
||||
};
|
||||
|
||||
const RewardsDashboardCard = ({ label, value, withIcon, hint, isLoading, bottomText }: Props) => (
|
||||
const RewardsDashboardCardValue = ({ label, value, withIcon, hint, isLoading, bottomText }: Props) => (
|
||||
<Flex key={ label } flexDirection="column" alignItems="center" gap={ 2 }>
|
||||
{ label && (
|
||||
<Flex alignItems="center" gap={ 1 }>
|
||||
@@ -49,4 +49,4 @@ const RewardsDashboardCard = ({ label, value, withIcon, hint, isLoading, bottomT
|
||||
</Flex>
|
||||
);
|
||||
|
||||
export default RewardsDashboardCard;
|
||||
export default RewardsDashboardCardValue;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable consistent-default-export-name/default-export-match-filename */
|
||||
import type { AppKitNetwork } from '@reown/appkit/networks';
|
||||
import { createAppKit, useAppKitTheme } from '@reown/appkit/react';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable consistent-default-export-name/default-export-match-filename */
|
||||
import React from 'react';
|
||||
|
||||
import type { Props } from './types';
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as Layout from './components';
|
||||
const TOP_BAR_HEIGHT = 36;
|
||||
const HEADER_HEIGHT_MOBILE = 56;
|
||||
|
||||
const LayoutDefault = ({ children }: Props) => {
|
||||
const LayoutApp = ({ children }: Props) => {
|
||||
return (
|
||||
<Layout.Root content={ children }>
|
||||
<Layout.Container
|
||||
@@ -45,4 +45,4 @@ const LayoutDefault = ({ children }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default LayoutDefault;
|
||||
export default LayoutApp;
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface Props {
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
const ZkEvmL2TxnBatchStatus = ({ status, isLoading }: Props) => {
|
||||
const ScrollL2TxnBatchStatus = ({ status, isLoading }: Props) => {
|
||||
let type: StatusTagType;
|
||||
|
||||
switch (status) {
|
||||
@@ -23,4 +23,4 @@ const ZkEvmL2TxnBatchStatus = ({ status, isLoading }: Props) => {
|
||||
return <StatusTag type={ type } text={ status } loading={ isLoading }/>;
|
||||
};
|
||||
|
||||
export default ZkEvmL2TxnBatchStatus;
|
||||
export default ScrollL2TxnBatchStatus;
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
onClear: () => void;
|
||||
};
|
||||
|
||||
const SearchBarSuggest = ({ onClick, onClear }: Props) => {
|
||||
const SearchBarRecentKeywords = ({ onClick, onClear }: Props) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const [ keywords, setKeywords ] = React.useState<Array<string>>(getRecentSearchKeywords());
|
||||
@@ -92,4 +92,4 @@ const SearchBarSuggest = ({ onClick, onClear }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default SearchBarSuggest;
|
||||
export default SearchBarRecentKeywords;
|
||||
|
||||
@@ -24,7 +24,7 @@ type Props = {
|
||||
tabsHeight?: number;
|
||||
};
|
||||
|
||||
const TokenHoldersContent = ({ holdersQuery, token, shouldRender = true, tabsHeight = TABS_HEIGHT }: Props) => {
|
||||
const TokenHolders = ({ holdersQuery, token, shouldRender = true, tabsHeight = TABS_HEIGHT }: Props) => {
|
||||
const isMobile = useIsMobile();
|
||||
const isMounted = useIsMounted();
|
||||
|
||||
@@ -83,4 +83,4 @@ const TokenHoldersContent = ({ holdersQuery, token, shouldRender = true, tabsHei
|
||||
);
|
||||
};
|
||||
|
||||
export default TokenHoldersContent;
|
||||
export default TokenHolders;
|
||||
|
||||
@@ -23,7 +23,7 @@ type Props = {
|
||||
|
||||
const bridgedTokensFeature = config.features.bridgedTokens;
|
||||
|
||||
const TokensTableItem = ({
|
||||
const TokensListItem = ({
|
||||
token,
|
||||
page,
|
||||
index,
|
||||
@@ -101,4 +101,4 @@ const TokensTableItem = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default TokensTableItem;
|
||||
export default TokensListItem;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { TxBlob } from 'types/api/blobs';
|
||||
|
||||
import TxBlobListItem from './TxBlobListItem';
|
||||
|
||||
const TxBlobList = ({ data, isLoading }: { data: Array<TxBlob>; isLoading?: boolean }) => {
|
||||
const TxBlobsList = ({ data, isLoading }: { data: Array<TxBlob>; isLoading?: boolean }) => {
|
||||
return (
|
||||
<Box>
|
||||
{ data.map((item, index) => (
|
||||
@@ -19,4 +19,4 @@ const TxBlobList = ({ data, isLoading }: { data: Array<TxBlob>; isLoading?: bool
|
||||
);
|
||||
};
|
||||
|
||||
export default TxBlobList;
|
||||
export default TxBlobsList;
|
||||
|
||||
@@ -20,7 +20,7 @@ const rollupFeature = config.features.rollup;
|
||||
|
||||
type Props = { item: ArbitrumL2TxnBatchesItem; isLoading?: boolean };
|
||||
|
||||
const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
const ArbitrumL2TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
if (!rollupFeature.isEnabled || rollupFeature.type !== 'arbitrum') {
|
||||
return null;
|
||||
}
|
||||
@@ -78,4 +78,4 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TxnBatchesTableItem;
|
||||
export default ArbitrumL2TxnBatchesTableItem;
|
||||
|
||||
@@ -19,7 +19,7 @@ const rollupFeature = config.features.rollup;
|
||||
|
||||
type Props = { item: ScrollL2TxnBatch; isLoading?: boolean };
|
||||
|
||||
const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
const ScrollL2TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
if (!rollupFeature.isEnabled || rollupFeature.type !== 'scroll') {
|
||||
return null;
|
||||
}
|
||||
@@ -100,4 +100,4 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TxnBatchesTableItem;
|
||||
export default ScrollL2TxnBatchesTableItem;
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
isLoading?: boolean;
|
||||
};
|
||||
|
||||
const TxnBatchesTable = ({ items, top, isLoading }: Props) => {
|
||||
const ZkEvmTxnBatchesTable = ({ items, top, isLoading }: Props) => {
|
||||
return (
|
||||
<TableRoot minW="1100px">
|
||||
<TableHeaderSticky top={ top }>
|
||||
@@ -42,4 +42,4 @@ const TxnBatchesTable = ({ items, top, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TxnBatchesTable;
|
||||
export default ZkEvmTxnBatchesTable;
|
||||
|
||||
@@ -17,7 +17,7 @@ const rollupFeature = config.features.rollup;
|
||||
|
||||
type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean };
|
||||
|
||||
const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
const ZkEvmTxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') {
|
||||
return null;
|
||||
}
|
||||
@@ -80,4 +80,4 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TxnBatchesTableItem;
|
||||
export default ZkEvmTxnBatchesTableItem;
|
||||
|
||||
@@ -11,7 +11,7 @@ interface Props {
|
||||
isUserOpDataLoading: boolean;
|
||||
}
|
||||
|
||||
const TxDetailsActionsInterpretation = ({ hash, isUserOpDataLoading }: Props) => {
|
||||
const UserOpDetailsActions = ({ hash, isUserOpDataLoading }: Props) => {
|
||||
const interpretationQuery = useApiQuery('general:user_op_interpretation', {
|
||||
pathParams: { hash },
|
||||
queryOptions: {
|
||||
@@ -45,4 +45,4 @@ const TxDetailsActionsInterpretation = ({ hash, isUserOpDataLoading }: Props) =>
|
||||
);
|
||||
};
|
||||
|
||||
export default TxDetailsActionsInterpretation;
|
||||
export default UserOpDetailsActions;
|
||||
|
||||
@@ -21,7 +21,7 @@ interface Props {
|
||||
hasEmail: boolean;
|
||||
}
|
||||
|
||||
const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick, hasEmail }: Props) => {
|
||||
const WatchListTableItem = ({ item, isLoading, onEditClick, onDeleteClick, hasEmail }: Props) => {
|
||||
const [ notificationEnabled, setNotificationEnabled ] = useState(item.notification_methods.email);
|
||||
const [ switchDisabled, setSwitchDisabled ] = useState(false);
|
||||
const onItemEditClick = useCallback(() => {
|
||||
@@ -96,4 +96,4 @@ const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick, hasEm
|
||||
);
|
||||
};
|
||||
|
||||
export default WatchlistTableItem;
|
||||
export default WatchListTableItem;
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
isLoading?: boolean;
|
||||
};
|
||||
|
||||
const ZkEvmL2DepositsTable = ({ items, top, isLoading }: Props) => {
|
||||
const ZkEvmL2WithdrawalsTable = ({ items, top, isLoading }: Props) => {
|
||||
return (
|
||||
<TableRoot tableLayout="auto" minW="950px">
|
||||
<TableHeaderSticky top={ top }>
|
||||
@@ -39,4 +39,4 @@ const ZkEvmL2DepositsTable = ({ items, top, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ZkEvmL2DepositsTable;
|
||||
export default ZkEvmL2WithdrawalsTable;
|
||||
|
||||
@@ -36,7 +36,7 @@ const hasNextPageFn = (nextPageParams: Record<string, unknown>) => {
|
||||
return nextPageParams.limit !== '0';
|
||||
};
|
||||
|
||||
const ZetaChainEvmTransactions = () => {
|
||||
const ZetaChainCCTXsTab = () => {
|
||||
const router = useRouter();
|
||||
const tab = getQueryParamString(router.query.tab);
|
||||
const isMobile = useIsMobile();
|
||||
@@ -185,4 +185,4 @@ const ZetaChainEvmTransactions = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ZetaChainEvmTransactions;
|
||||
export default ZetaChainCCTXsTab;
|
||||
|
||||
@@ -12317,6 +12317,14 @@ eslint-module-utils@^2.7.4:
|
||||
dependencies:
|
||||
debug "^3.2.7"
|
||||
|
||||
eslint-plugin-consistent-default-export-name@^0.0.15:
|
||||
version "0.0.15"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-consistent-default-export-name/-/eslint-plugin-consistent-default-export-name-0.0.15.tgz#c2050daf34c96c833cd9b40785cfa64953e8dc3c"
|
||||
integrity sha512-gqW7dnJbWMxI5H6/Pyz6Sl/vBMwOktePMI2iuuKPb4N82uvemUkfaWhsRZCKndSzpIVaCZ9wdspCVO1tm0wXJQ==
|
||||
dependencies:
|
||||
lodash "^4.17.21"
|
||||
pkg-dir "^5.0.0"
|
||||
|
||||
[email protected]:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-import-helpers/-/eslint-plugin-import-helpers-2.0.1.tgz#3a5c451b0fe303987931b369cb89d6a3b7eca2d5"
|
||||
@@ -16904,6 +16912,13 @@ pkg-dir@^4.2.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
pkg-dir@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
|
||||
integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
|
||||
dependencies:
|
||||
find-up "^5.0.0"
|
||||
|
||||
pkg-types@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868"
|
||||
|
||||
Reference in New Issue
Block a user