From ced72db09fd5f8ade8fb395e551a269f030ea690 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Wed, 3 Sep 2025 09:17:50 +0100 Subject: [PATCH] Enable ESLint no-unused-expressions rule --- frontend/eslint.config.mjs | 1 - frontend/src/components/tools/toolPicker/ToolSearch.tsx | 2 +- frontend/src/index.tsx | 7 +++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 7922013cb..e52bdfa32 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -25,7 +25,6 @@ export default defineConfig( "@typescript-eslint/no-empty-object-type": "off", // Temporarily disabled until codebase conformant "@typescript-eslint/no-explicit-any": "off", // Temporarily disabled until codebase conformant "@typescript-eslint/no-require-imports": "off", // Temporarily disabled until codebase conformant - "@typescript-eslint/no-unused-expressions": "off", // Temporarily disabled until codebase conformant "@typescript-eslint/no-unused-vars": "off", // Temporarily disabled until codebase conformant }, } diff --git a/frontend/src/components/tools/toolPicker/ToolSearch.tsx b/frontend/src/components/tools/toolPicker/ToolSearch.tsx index 53a01cb77..d4350044e 100644 --- a/frontend/src/components/tools/toolPicker/ToolSearch.tsx +++ b/frontend/src/components/tools/toolPicker/ToolSearch.tsx @@ -126,7 +126,7 @@ const ToolSearch = ({ key={id} variant="subtle" onClick={() => { - onToolSelect && onToolSelect(id); + onToolSelect?.(id); setDropdownOpen(false); }} leftSection={
{tool.icon}
} diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 55fe7f046..38a0c1923 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -35,8 +35,11 @@ function updatePosthogConsent(){ return; } const optIn = (window.CookieConsent as any).acceptedCategory('analytics'); - optIn? - posthog.opt_in_capturing() : posthog.opt_out_capturing(); + if (optIn) { + posthog.opt_in_capturing(); + } else { + posthog.opt_out_capturing(); + } console.log("Updated analytics consent: ", optIn? "opted in" : "opted out"); }