Skip to content

Commit

Permalink
fix: run config validation for falsy value
Browse files Browse the repository at this point in the history
0 is considered as falsy but it's still a valid config
  • Loading branch information
KamiKillertO committed Apr 21, 2020
1 parent 11dd893 commit 856dcf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Config {
if (shouldActiveRule(config[rule.name])) {
let ruleConfig = extractRuleConfig(config[rule.name], rule.name);
this.activatedRules[rule.name] = rule;
if (ruleConfig) {
if (ruleConfig !== null && ruleConfig !== undefined) {
ruleConfig = rule.configTransform ? rule.configTransform(ruleConfig) : ruleConfig;
if (rule.validateConfig) {
rule.validateConfig(ruleConfig);
Expand Down

0 comments on commit 856dcf6

Please sign in to comment.