Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: refactor linter#parseBooleanConfig to improve readability #11074

Merged
merged 4 commits into from Nov 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions lib/linter.js
Expand Up @@ -76,19 +76,13 @@ 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(":");
aladdin-add marked this conversation as resolved.
Show resolved Hide resolved

items[key] = {
value: value === "true",
comment
};
});
return items;
}
Expand Down