From d54124afad972bf827aa1971dce1647ad4ae0f6a Mon Sep 17 00:00:00 2001 From: Pangerkumzuk Longkumer <73515951+pangerlkr@users.noreply.github.com> Date: Wed, 18 Feb 2026 07:14:32 +0530 Subject: [PATCH] fix: remove useless escape characters in regex patterns (no-useless-escape ESLint) --- scripts/lib/package-manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/package-manager.js b/scripts/lib/package-manager.js index c12537f0..7eefc3c9 100644 --- a/scripts/lib/package-manager.js +++ b/scripts/lib/package-manager.js @@ -282,7 +282,7 @@ function setProjectPackageManager(pmName, projectDir = process.cwd()) { // Allowed characters in script/binary names: alphanumeric, dash, underscore, dot, slash, @ // This prevents shell metacharacter injection while allowing scoped packages (e.g., @scope/pkg) -const SAFE_NAME_REGEX = /^[@a-zA-Z0-9_.\/-]+$/; +const SAFE_NAME_REGEX = /^[\[@a-zA-Z0-9_./-]+$/; /** * Get the command to run a script @@ -316,7 +316,7 @@ function getRunCommand(script, options = {}) { // Allowed characters in arguments: alphanumeric, whitespace, dashes, dots, slashes, // equals, colons, commas, quotes, @. Rejects shell metacharacters like ; | & ` $ ( ) { } < > ! -const SAFE_ARGS_REGEX = /^[@a-zA-Z0-9\s_.\/:=,'"*+-]+$/; +const SAFE_ARGS_REGEX = /^[@a-zA-Z0-9\s_./:=,'"*+-]+$/; /** * Get the command to execute a package binary