From 7d0ea883b01f68d056e123d5f95f751d99e60cb5 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 8 Jul 2026 23:07:04 -0400 Subject: [PATCH] fix: drop useless string concat in devTools KEY to unblock CI build react-scripts build with CI=true treats the no-useless-concat ESLint warning as an error. DefinePlugin inlining is already prevented by the dynamic process.env[KEY] lookup, so the literal split was unnecessary. Co-Authored-By: Claude Opus 4.8 --- src/config/devTools.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config/devTools.js b/src/config/devTools.js index ba3241c..41f61cd 100644 --- a/src/config/devTools.js +++ b/src/config/devTools.js @@ -1,6 +1,7 @@ // Dev-tools gate. Explicit opt-in via REACT_APP_DEV_TOOLS=1. // Safe default: any value other than exactly '1' = off. -// Dynamic key access so react-scripts DefinePlugin does NOT inline the value -// at build time — allows tests + runtime env changes to take effect. -const KEY = 'REACT_APP_' + 'DEV_TOOLS'; +// Dynamic key access (process.env[KEY]) so react-scripts DefinePlugin does NOT +// inline the value at build time — allows tests + runtime env changes to take +// effect. DefinePlugin only replaces static member access, never computed lookups. +const KEY = 'REACT_APP_DEV_TOOLS'; export const isDevToolsEnabled = () => process.env[KEY] === '1';