From 6f727b6662594651b57d1d633377485a750781b5 Mon Sep 17 00:00:00 2001 From: "jeetul.samaiya" Date: Sun, 7 Sep 2025 14:22:14 +0530 Subject: [PATCH] fix: update error handling in JSON parsing and add ESLint rule for unused variables --- client/eslint.config.js | 4 ++++ client/src/components/CustomHeaders.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/eslint.config.js b/client/eslint.config.js index 79a552ea..c689c75d 100644 --- a/client/eslint.config.js +++ b/client/eslint.config.js @@ -23,6 +23,10 @@ export default tseslint.config( "warn", { allowConstantExport: true }, ], + "@typescript-eslint/no-unused-vars": [ + "error", + { argsIgnorePattern: "^_" }, + ], }, }, ); diff --git a/client/src/components/CustomHeaders.tsx b/client/src/components/CustomHeaders.tsx index 35b12212..67aee18d 100644 --- a/client/src/components/CustomHeaders.tsx +++ b/client/src/components/CustomHeaders.tsx @@ -90,7 +90,7 @@ const CustomHeaders = ({ onChange(newHeaders); setJsonError(null); setIsJsonMode(false); - } catch (error) { + } catch { setJsonError("Invalid JSON format"); } };