Skip to content

Commit

Permalink
refactor: simplify parseListConfig (#16241)
Browse files Browse the repository at this point in the history
* refactor: simplify `parseListConfig`

Removes a polynomial-time regular expression

* remove comment
  • Loading branch information
mdjermanovic committed Aug 24, 2022
1 parent 43f03aa commit 63dec9f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/linter/config-comment-parser.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 63dec9f

Please sign in to comment.