From e1be541b4ed8ca24438251f1ad25185ae0b726c2 Mon Sep 17 00:00:00 2001 From: amalv <1252707+amalv@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:47:32 +0100 Subject: [PATCH] feat(eslint): add no-console, complexity, and max-depth rules --- .eslintrc.cjs | 3 +++ src/contexts/AuthProvider.tsx | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e2aa795..665557c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -18,6 +18,9 @@ module.exports = { parser: "@typescript-eslint/parser", plugins: ["react-refresh"], rules: { + "no-console": "error", + complexity: ["error", { max: 10 }], + "max-depth": ["error", { max: 4 }], "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, diff --git a/src/contexts/AuthProvider.tsx b/src/contexts/AuthProvider.tsx index 6910529..757a86e 100644 --- a/src/contexts/AuthProvider.tsx +++ b/src/contexts/AuthProvider.tsx @@ -23,7 +23,6 @@ const decodeToken = (accessToken: string) => { const timeoutDuration = expiryTime - Date.now() - 60 * 1000; // Refresh 1 minute before expiry return timeoutDuration; } catch (error) { - console.error("Invalid token", error); return null; } };