From 6500a396c4e11fb925c54bffff3d250643d45002 Mon Sep 17 00:00:00 2001 From: shulaoda Date: Tue, 20 Aug 2024 16:17:07 +0800 Subject: [PATCH] chore(infra/biome): enable noGlobalEval --- biome.jsonc | 3 --- packages/rspack/src/loader-runner/loadLoader.ts | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index b2908ab3e6f..310416ee5b8 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -48,9 +48,6 @@ "performance": { "noDelete": "off" }, - "security": { - "noGlobalEval": "off" - }, "suspicious": { "noFallthroughSwitchClause": "off", "noConfusingVoidType": "off", diff --git a/packages/rspack/src/loader-runner/loadLoader.ts b/packages/rspack/src/loader-runner/loadLoader.ts index 788ff25816b..d734e67bcc1 100644 --- a/packages/rspack/src/loader-runner/loadLoader.ts +++ b/packages/rspack/src/loader-runner/loadLoader.ts @@ -31,9 +31,7 @@ export default function loadLoader( try { if (url === undefined) url = require("node:url"); const loaderUrl = url!.pathToFileURL(loader.path); - const modulePromise = eval( - `import(${JSON.stringify(loaderUrl.toString())})` - ); + const modulePromise = import(JSON.stringify(loaderUrl.toString())); modulePromise.then((module: LoaderModule) => { handleResult(loader, module, callback); }, callback);