From 7171fca6ef4e0e8f267658fc7d8f603f00eddd84 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Fri, 20 Dec 2019 05:18:48 +0100 Subject: [PATCH] Chore: refactor regex in config comment parser (#12662) --- lib/linter/config-comment-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter/config-comment-parser.js b/lib/linter/config-comment-parser.js index d0e24c5940e..35862315d51 100644 --- a/lib/linter/config-comment-parser.js +++ b/lib/linter/config-comment-parser.js @@ -90,7 +90,7 @@ module.exports = class ConfigCommentParser { * But we are supporting that. So this is a fallback for that. */ items = {}; - const normalizedString = string.replace(/([a-zA-Z0-9\-/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,"); try { items = JSON.parse(`{${normalizedString}}`);