diff --git a/.gitignore b/.gitignore index 7c52653..916bfd9 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ yarn-error.log* # typescript *.tsbuildinfo .env + +.eslintcache diff --git a/components/Layout/NetworkSelector.tsx b/components/Layout/NetworkSelector.tsx index 960d44c..049f47c 100644 --- a/components/Layout/NetworkSelector.tsx +++ b/components/Layout/NetworkSelector.tsx @@ -1,7 +1,7 @@ -import { FC, useEffect, useRef } from 'react'; +import { type FC, useEffect, useRef } from 'react'; import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; import { clusterApiUrl, Connection } from '@solana/web3.js'; -import { Network, useConnection } from 'contexts'; +import { type Network, useConnection } from 'contexts'; const RPC_API_DEVNET = process.env.NEXT_PUBLIC_RPC_API_DEVNET || clusterApiUrl('devnet'); diff --git a/components/Layout/Wallet.tsx b/components/Layout/Wallet.tsx index a1fbaf9..cbdf2ed 100644 --- a/components/Layout/Wallet.tsx +++ b/components/Layout/Wallet.tsx @@ -1,5 +1,6 @@ +import type { FC } from 'react'; + import { WalletMultiButton } from '@solana/wallet-adapter-react-ui'; -import { FC } from 'react'; const Wallet: FC = () => (
{ try { const mint = Keypair.generate(); diff --git a/lib/spl.ts b/lib/spl.ts index 6eb0d8a..7be12d6 100644 --- a/lib/spl.ts +++ b/lib/spl.ts @@ -4,7 +4,7 @@ import { Connection, Keypair, - ParsedAccountData, + type ParsedAccountData, PublicKey, Transaction, TransactionInstruction, diff --git a/pages/_app.tsx b/pages/_app.tsx index 9ae5cf5..e05e607 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import '../styles/globals.scss'; import type { AppProps } from 'next/app'; -import React, { ReactNode, useMemo, useState } from 'react'; +import type { Network } from 'contexts'; + +import { type ReactNode, useMemo, useState, type FC } from 'react'; import { WalletProvider } from '@solana/wallet-adapter-react'; import { GlowWalletAdapter, @@ -18,11 +19,11 @@ import { ThemeProvider, BaseStyles, theme, - ThemeProviderProps, + type ThemeProviderProps, } from '@primer/react'; import deepmerge from 'deepmerge'; import { ConnectionContext } from 'contexts'; -import type { Network } from 'contexts'; +import '../styles/globals.scss'; const customTheme = deepmerge(theme, { fonts: { @@ -36,11 +37,10 @@ const customTheme = deepmerge(theme, { }, }); -const CustomThemeProvider: React.FC< - ThemeProviderProps & { children: ReactNode } -> = ({ children, ...props }) => ( - {children} -); +const CustomThemeProvider: FC = ({ + children, + ...props +}) => {children}; function MyApp({ Component, pageProps }: AppProps) { const [connection, setConnection] = useState(null); diff --git a/pages/api/mint.ts b/pages/api/mint.ts index f451490..cffed62 100644 --- a/pages/api/mint.ts +++ b/pages/api/mint.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction import type { NextApiRequest, NextApiResponse } from 'next'; + import { RpcMethods } from 'lib/spl'; import { Database } from 'db/lib'; import { clusterApiUrl, Connection, Keypair } from '@solana/web3.js'; diff --git a/pages/api/mongo-get.ts b/pages/api/mongo-get.ts index a28ed3f..a960c06 100644 --- a/pages/api/mongo-get.ts +++ b/pages/api/mongo-get.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { NextApiRequest, NextApiResponse } from 'next'; -import { Database, Query } from 'db/lib'; +import type { NextApiRequest, NextApiResponse } from 'next'; + +import { Database, type Query } from 'db/lib'; interface Res { queryResults?: Query[]; diff --git a/pages/api/mongo-new-token.ts b/pages/api/mongo-new-token.ts index 8d3e223..1317199 100644 --- a/pages/api/mongo-new-token.ts +++ b/pages/api/mongo-new-token.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { NextApiRequest, NextApiResponse } from 'next'; +import type { NextApiRequest, NextApiResponse } from 'next'; +import type { NewToken } from 'types'; + import { Database } from 'db/lib'; -import { NewToken } from 'types'; interface Res { token?: string; diff --git a/pages/api/transfer.ts b/pages/api/transfer.ts index 9e0240a..2df2887 100644 --- a/pages/api/transfer.ts +++ b/pages/api/transfer.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import type { NextApiRequest, NextApiResponse } from 'next'; + import { RpcMethods } from 'lib/spl'; import { Connection, Keypair } from '@solana/web3.js'; import { Database } from 'db/lib'; diff --git a/pages/index.tsx b/pages/index.tsx index 9fad411..e50b0fb 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,16 +1,15 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import type { NextPage } from 'next'; + import Head from 'next/head'; import { Header } from 'components/Layout'; import { Table } from 'components/Table'; -import { StyledOcticon } from '@primer/react'; -import { HeartFillIcon } from '@primer/octicons-react'; import { Toast } from 'components/Layout'; import { version } from 'version.json'; import { HasMongoUriContext } from 'contexts'; export function getServerSideProps() { - const HAS_MONGO_URI = !!process.env.NEXT_PUBLIC_DATABASE_URL; + const HAS_MONGO_URI = Boolean(process.env.NEXT_PUBLIC_DATABASE_URL); return { props: { HAS_MONGO_URI } }; } diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 718d6fe..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/vercel.svg b/public/vercel.svg deleted file mode 100644 index fbf0e25..0000000 --- a/public/vercel.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file