From 9d607a67747df0f31c6f835a552f1f2958a6cd43 Mon Sep 17 00:00:00 2001 From: Dhaiwat Pandya Date: Wed, 1 Dec 2021 02:08:35 +0530 Subject: [PATCH] Update eslint rules --- packages/react-app/.eslintrc.js | 3 ++- packages/react-app/pages/index.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-app/.eslintrc.js b/packages/react-app/.eslintrc.js index e8f90db..9727971 100644 --- a/packages/react-app/.eslintrc.js +++ b/packages/react-app/.eslintrc.js @@ -1,11 +1,12 @@ module.exports = { env: { browser: true, + es6: true, }, extends: ["eslint:recommended", "prettier", "next"], rules: { "no-console": "warn", - "no-undef": "warn", + "no-undef": "error", "react-hooks/rules-of-hooks": "warn", }, }; diff --git a/packages/react-app/pages/index.js b/packages/react-app/pages/index.js index bb3aade..cac0766 100644 --- a/packages/react-app/pages/index.js +++ b/packages/react-app/pages/index.js @@ -35,6 +35,7 @@ function Home() { }, ]; try { + // eslint-disable-next-line no-undef await ethereum.request({ method: "wallet_switchEthereumChain", params: [{ chainId: data[0].chainId }], @@ -44,6 +45,7 @@ function Home() { // This error code indicates that the chain has not been added to MetaMask. if (switchError.code === 4902) { try { + // eslint-disable-next-line no-undef await ethereum.request({ method: "wallet_addEthereumChain", params: data,