Chore: update ESLint config

This commit is contained in:
SukkaW
2023-09-29 02:32:28 +08:00
parent ac2f5d56a9
commit 970e4dcc85
10 changed files with 197 additions and 31 deletions

View File

@@ -182,7 +182,7 @@ function matchWithRegExpArray(input, regexps = []) {
function escapeRegExp(string = '') {
const reRegExpChar = /[$()*+.?[\\\]^{|}]/g;
const reHasRegExpChar = RegExp(reRegExpChar.source);
const reHasRegExpChar = new RegExp(reRegExpChar.source);
return string && reHasRegExpChar.test(string)
? string.replaceAll(reRegExpChar, '\\$&')