From 4787bdcbfff775ae8fed097c863164e2e78cd512 Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Sun, 17 Oct 2021 18:09:32 +1300 Subject: [PATCH] chore: fix compatibility with node 12 and 14 --- .eslintrc.json | 4 +++- src/common/ignore-options.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 946127ceb..e84c8d766 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -44,7 +44,9 @@ "node/no-unsupported-features/es-syntax": "off", "promise/prefer-await-to-callbacks": "off", // enable once supported in all our supported node versions. - "unicorn/prefer-node-protocol": "off" + "unicorn/prefer-node-protocol": "off", + // only available for node >= 16 + "unicorn/prefer-string-replace-all": "off" }, "overrides": [ // Top level files. diff --git a/src/common/ignore-options.ts b/src/common/ignore-options.ts index 864651afd..5f0016faf 100644 --- a/src/common/ignore-options.ts +++ b/src/common/ignore-options.ts @@ -216,7 +216,7 @@ function accessorPatternMatch( ) : // Text matches pattern? new RegExp( - `^${escapeRegExp(pattern).replaceAll("\\*", ".*")}$`, + `^${escapeRegExp(pattern).replace(/\\\*/gu, ".*")}$`, "u" ).test(textParts[0]) && accessorPatternMatch(