diff --git a/lib/linter.js b/lib/linter.js index b47e6eb1fcfb..c677810df4ef 100644 --- a/lib/linter.js +++ b/lib/linter.js @@ -76,19 +76,12 @@ function parseBooleanConfig(string, comment) { if (!name) { return; } - const pos = name.indexOf(":"); - if (pos === -1) { - items[name] = { - value: false, - comment - }; - } else { - items[name.slice(0, pos)] = { - value: name.slice(pos + 1) === "true", - comment - }; - } + const [key, value] = name.split(":"); + items[key] = { + value: value === "true", + comment + }; }); return items; }