From 5441a4b3306ddb91d5288f1b378648d347384dbd Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Thu, 14 Mar 2024 18:02:53 +0100 Subject: [PATCH] Lint rule to ban process.env.REACT_APP_ENABLE_OASIS_MATOMO_ANALYTICS --- .eslintrc.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 733cfcb76..77d6798bd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -38,6 +38,15 @@ const config = { ], }, ], + 'no-restricted-syntax': [ + 'error', + { + selector: + 'MemberExpression[object.object.name="process"][object.property.name="env"][property.name="REACT_APP_ENABLE_OASIS_MATOMO_ANALYTICS"]', + message: + 'Replace with window.REACT_APP_ENABLE_OASIS_MATOMO_ANALYTICS to support overriding in e2e tests', + }, + ], 'prefer-template': 'error', 'react/jsx-no-target-blank': 'off', // Not needed with modern browsers