From b71871fa0048c1a8ee3c3e2740fc7d54b5ace758 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Wed, 24 Aug 2022 15:05:39 +0200 Subject: [PATCH 1/2] refactor: simplify `parseListConfig` Removes a polynomial-time regular expression --- 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 b88c5e6c850..aac511de2ee 100644 --- a/lib/linter/config-comment-parser.js +++ b/lib/linter/config-comment-parser.js @@ -132,7 +132,7 @@ module.exports = class ConfigCommentParser { const items = {}; // Collapse whitespace around commas - string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { + string.split(",").forEach(name => { const trimmedName = name.trim(); if (trimmedName) { From 0af9c5dcd06afc0cf3777c5647c8fae63c17fdcf Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Wed, 24 Aug 2022 15:33:17 +0200 Subject: [PATCH 2/2] remove comment --- lib/linter/config-comment-parser.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linter/config-comment-parser.js b/lib/linter/config-comment-parser.js index aac511de2ee..643de8f2d31 100644 --- a/lib/linter/config-comment-parser.js +++ b/lib/linter/config-comment-parser.js @@ -131,7 +131,6 @@ module.exports = class ConfigCommentParser { const items = {}; - // Collapse whitespace around commas string.split(",").forEach(name => { const trimmedName = name.trim();