From a8cd75a0810acef52f43b88a55891f7c3323dba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=BC=E6=97=8F=E5=B0=8F=E7=8B=88?= <1340641314@qq.com> Date: Thu, 23 Dec 2021 19:33:16 +0800 Subject: [PATCH] Update isAbsoluteURL.js (#3809) Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect, as demonstrated in the following example: https://eslint.org/docs/rules/no-useless-escape Co-authored-by: Jay --- lib/helpers/isAbsoluteURL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers/isAbsoluteURL.js b/lib/helpers/isAbsoluteURL.js index d33e99275c..43fea788a8 100644 --- a/lib/helpers/isAbsoluteURL.js +++ b/lib/helpers/isAbsoluteURL.js @@ -10,5 +10,5 @@ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); };