From 94e8f603ffe9f1970f1f27fdacf20536b13df90f Mon Sep 17 00:00:00 2001 From: James Brunton Date: Thu, 4 Sep 2025 16:12:38 +0100 Subject: [PATCH] Enable ESLint no-unused-expressions rule (#4363) # Description of Changes Enable ESLint [no-unused-expressions rule](https://typescript-eslint.io/rules/no-unused-expressions/) --- 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 98acb81c4..6bce88115 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -22,7 +22,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"); }