From 62bb4df8d748ced00b8a41a49c228b055827f542 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Thu, 15 Sep 2022 10:02:19 -0700 Subject: [PATCH] Remove direct eval from react devtools Reviewed By: lblasa Differential Revision: D39467192 fbshipit-source-id: 925678b17c9a454298aa141eb19e1ae6aa9c369f --- desktop/plugins/public/reactdevtools/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/reactdevtools/index.tsx b/desktop/plugins/public/reactdevtools/index.tsx index b07c124db..233bca957 100644 --- a/desktop/plugins/public/reactdevtools/index.tsx +++ b/desktop/plugins/public/reactdevtools/index.tsx @@ -78,8 +78,9 @@ export function devicePlugin(client: DevicePluginClient) { if (newGlobalDevToolsSource) { globalDevToolsInstance = { type: 'global', + // https://esbuild.github.io/content-types/#direct-eval // eslint-disable-next-line no-eval - module: eval(newGlobalDevToolsSource), + module: (0, eval)(newGlobalDevToolsSource), }; globalDevToolsAvailable.set(true);