From cdfba739e73ca39fcfe9dc3b348e09da7ca7238b Mon Sep 17 00:00:00 2001 From: Jesse Snyder Date: Fri, 10 Jan 2025 18:07:50 -0700 Subject: [PATCH] fix lints --- apps/web/app/components/Navbar/Navbar.tsx | 2 +- .../web/app/components/WithdrawCard/WithdrawCard.tsx | 3 +-- apps/web/app/config/contexts/ConfigContext.tsx | 4 ++-- .../ConnectCosmosWalletButton.tsx | 2 +- .../CosmosWallet/contexts/CosmosWalletContext.tsx | 2 +- .../features/EvmWallet/contexts/EvmWalletContext.tsx | 3 +-- .../AstriaWithdrawerService.test.ts | 12 ++++++------ .../GetBalancePolling/hooks/useGetBalancePolling.ts | 4 ++-- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/apps/web/app/components/Navbar/Navbar.tsx b/apps/web/app/components/Navbar/Navbar.tsx index fa5eaa5..6c61728 100644 --- a/apps/web/app/components/Navbar/Navbar.tsx +++ b/apps/web/app/components/Navbar/Navbar.tsx @@ -12,7 +12,7 @@ import ConnectWalletsButton from "../ConnectWalletsButton/ConnectWalletsButton"; function Navbar() { const [isMobileMenuActive, setIsMobileMenuActive] = useState(false); - const onHamburgerClick = (_: React.SyntheticEvent) => { + const onHamburgerClick = () => { setIsMobileMenuActive((prev) => !prev); }; diff --git a/apps/web/app/components/WithdrawCard/WithdrawCard.tsx b/apps/web/app/components/WithdrawCard/WithdrawCard.tsx index 3d80271..541a19f 100644 --- a/apps/web/app/components/WithdrawCard/WithdrawCard.tsx +++ b/apps/web/app/components/WithdrawCard/WithdrawCard.tsx @@ -135,13 +135,12 @@ export default function WithdrawCard(): React.ReactElement { }, [connectCosmosWallet]); // ensure evm wallet connection when selected EVM chain changes - /* biome-ignore lint/correctness/useExhaustiveDependencies: */ useEffect(() => { if (!selectedEvmChain) { return; } connectEvmWallet(); - }, [selectedEvmChain]); + }, [connectEvmWallet, selectedEvmChain]); // ensure cosmos wallet connection when selected ibc chain changes useEffect(() => { diff --git a/apps/web/app/config/contexts/ConfigContext.tsx b/apps/web/app/config/contexts/ConfigContext.tsx index 4920573..4e7916b 100644 --- a/apps/web/app/config/contexts/ConfigContext.tsx +++ b/apps/web/app/config/contexts/ConfigContext.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useEffect } from "react"; +import React from "react"; import { FlameNetwork, getChainConfigs } from "../chainConfigs"; import { getEnvVariable } from "../env"; @@ -29,7 +29,7 @@ export const ConfigContextProvider: React.FC = ({ let feedbackFormURL: string | null; try { feedbackFormURL = getEnvVariable("NEXT_PUBLIC_FEEDBACK_FORM_URL"); - } catch (e) { + } catch { feedbackFormURL = null; } diff --git a/apps/web/app/features/CosmosWallet/components/ConnectCosmosWalletButton/ConnectCosmosWalletButton.tsx b/apps/web/app/features/CosmosWallet/components/ConnectCosmosWalletButton/ConnectCosmosWalletButton.tsx index cb955b8..439dbea 100644 --- a/apps/web/app/features/CosmosWallet/components/ConnectCosmosWalletButton/ConnectCosmosWalletButton.tsx +++ b/apps/web/app/features/CosmosWallet/components/ConnectCosmosWalletButton/ConnectCosmosWalletButton.tsx @@ -78,7 +78,7 @@ export default function ConnectCosmosWalletButton({ await disconnectCosmosWallet(); }; - disconnect().then((_) => {}); + disconnect().then(() => {}); }, [disconnectCosmosWallet]); return ( diff --git a/apps/web/app/features/CosmosWallet/contexts/CosmosWalletContext.tsx b/apps/web/app/features/CosmosWallet/contexts/CosmosWalletContext.tsx index 4e6bdca..a655209 100644 --- a/apps/web/app/features/CosmosWallet/contexts/CosmosWalletContext.tsx +++ b/apps/web/app/features/CosmosWallet/contexts/CosmosWalletContext.tsx @@ -193,7 +193,7 @@ export const CosmosWalletProvider: React.FC = ({ ]); const disconnectCosmosWallet = useCallback(() => { - disconnect().then((_) => {}); + disconnect().then(() => {}); resetState(); }, [disconnect, resetState]); diff --git a/apps/web/app/features/EvmWallet/contexts/EvmWalletContext.tsx b/apps/web/app/features/EvmWallet/contexts/EvmWalletContext.tsx index 7e28383..a19484e 100644 --- a/apps/web/app/features/EvmWallet/contexts/EvmWalletContext.tsx +++ b/apps/web/app/features/EvmWallet/contexts/EvmWalletContext.tsx @@ -50,8 +50,7 @@ interface EvmWalletProviderProps { export const EvmWalletProvider: React.FC = ({ children, }) => { - const { evmChains, selectedFlameNetwork, selectFlameNetwork } = - useAppConfig(); + const { evmChains, selectedFlameNetwork } = useAppConfig(); const { openConnectModal } = useConnectModal(); const { disconnect } = useDisconnect(); diff --git a/apps/web/app/features/EvmWallet/services/AstriaWithdrawerService/AstriaWithdrawerService.test.ts b/apps/web/app/features/EvmWallet/services/AstriaWithdrawerService/AstriaWithdrawerService.test.ts index f4a4073..0a21be1 100644 --- a/apps/web/app/features/EvmWallet/services/AstriaWithdrawerService/AstriaWithdrawerService.test.ts +++ b/apps/web/app/features/EvmWallet/services/AstriaWithdrawerService/AstriaWithdrawerService.test.ts @@ -179,7 +179,7 @@ describe("AstriaWithdrawerService", () => { mockContractAddress, ); const writeContractMethodSpy = jest.spyOn( - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ service as any, "writeContractMethod", ); @@ -212,7 +212,7 @@ describe("AstriaWithdrawerService", () => { ); const errorMessage = "Withdrawal failed"; jest - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ .spyOn(service as any, "writeContractMethod") .mockRejectedValue(new Error(errorMessage)); @@ -246,7 +246,7 @@ describe("AstriaErc20WithdrawerService", () => { mockContractAddress, ); const writeContractMethodSpy = jest.spyOn( - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ service as any, "writeContractMethod", ); @@ -279,7 +279,7 @@ describe("AstriaErc20WithdrawerService", () => { ); const errorMessage = "ERC20 withdrawal failed"; jest - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ .spyOn(service as any, "writeContractMethod") .mockRejectedValue(new Error(errorMessage)); @@ -303,7 +303,7 @@ describe("AstriaErc20WithdrawerService", () => { mockContractAddress, ); const readContractMethodSpy = jest.spyOn( - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ service as any, "readContractMethod", ); @@ -323,7 +323,7 @@ describe("AstriaErc20WithdrawerService", () => { ); const errorMessage = "Balance check failed"; jest - // biome-ignore lint/suspicious/noExplicitAny: This is a test mock + /* eslint-disable @typescript-eslint/no-explicit-any */ .spyOn(service as any, "readContractMethod") .mockRejectedValue(new Error(errorMessage)); const mockAddress = "0x1234567890123456789012345678901234567890"; diff --git a/apps/web/app/features/GetBalancePolling/hooks/useGetBalancePolling.ts b/apps/web/app/features/GetBalancePolling/hooks/useGetBalancePolling.ts index 6349866..bfec5a8 100644 --- a/apps/web/app/features/GetBalancePolling/hooks/useGetBalancePolling.ts +++ b/apps/web/app/features/GetBalancePolling/hooks/useGetBalancePolling.ts @@ -35,10 +35,10 @@ export default function useBalancePolling( } finally { setIsLoading(false); } - }, [fetchBalance, config.enabled, config.onError]); + }, [config, fetchBalance]); useEffect(() => { - getBalance().then((_) => {}); + getBalance().then(() => {}); // setup polling if enabled if (config.enabled && config.intervalMS) {