Skip to content

Commit 421e4bf

Browse files
thefourtheyeilyavolodin
authored andcommitted
Chore: combine multiple RegEx replaces with one (fixes #6669) (#6661)
1 parent 089ee2c commit 421e4bf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/eslint.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ var assert = require("assert"),
4343
function parseBooleanConfig(string, comment) {
4444
var items = {};
4545

46-
// Collapse whitespace around : to make parsing easier
47-
string = string.replace(/\s*:\s*/g, ":");
48-
49-
// Collapse whitespace around ,
50-
string = string.replace(/\s*,\s*/g, ",");
46+
// Collapse whitespace around `:` and `,` to make parsing easier
47+
string = string.replace(/\s*([:,])\s*/g, "$1");
5148

5249
string.split(/\s|,+/).forEach(function(name) {
5350
if (!name) {

0 commit comments

Comments
 (0)