From b09e3acb12613ec6a2632d1dd9b41b5c85730828 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 8 Sep 2020 13:55:04 +0200 Subject: [PATCH] lint fixes --- .eslintrc | 4 +++- src/utils/wallet.ts | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.eslintrc b/.eslintrc index 538380cd5..e0664d271 100644 --- a/.eslintrc +++ b/.eslintrc @@ -28,7 +28,9 @@ "rules": { "react/prop-types": "off", "react/no-unused-prop-types": "off", - "@typescript-eslint/explicit-function-return-type": "off" + "@typescript-eslint/explicit-function-return-type": "off", + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": "error" } } ] diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index c39859427..0bacf3515 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -39,6 +39,19 @@ export const web3ModalOpts = { theme: web3ModalTheme } +export function getChainId(network: string): number { + switch (network) { + case 'mainnet': + return 1 + case 'rinkeby': + return 4 + case 'kovan': + return 42 + default: + return 0 + } +} + export function isCorrectNetwork(chainId: number): boolean { const configuredNetwork = getChainId(network) return configuredNetwork === chainId @@ -62,16 +75,3 @@ export function getNetworkName(chainId: number): string { return 'Unknown' } } - -export function getChainId(network: string): number { - switch (network) { - case 'mainnet': - return 1 - case 'rinkeby': - return 4 - case 'kovan': - return 42 - default: - return 0 - } -}