From 63dec9fdee793be9bf2939e1bda0717b9cc6dcf8 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Thu, 25 Aug 2022 00:23:11 +0200 Subject: [PATCH] refactor: simplify `parseListConfig` (#16241) * refactor: simplify `parseListConfig` Removes a polynomial-time regular expression * remove comment --- lib/linter/config-comment-parser.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/linter/config-comment-parser.js b/lib/linter/config-comment-parser.js index b88c5e6c850..643de8f2d31 100644 --- a/lib/linter/config-comment-parser.js +++ b/lib/linter/config-comment-parser.js @@ -131,8 +131,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) {