From 85c073259cb00a88a4da2c63f9a43ec383184d58 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: Mon, 24 May 2021 20:01:02 +0800 Subject: [PATCH] Update isAbsoluteURL.js 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 --- 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); };