Skip to content

Commit

Permalink
Warn when using a rule that doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Jan 28, 2020
1 parent 6551578 commit b80c320
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ module.exports = function checkers(reporter, configVals, inputSrc, tokens, fileN
}
}

const configRules = Object.keys(config.rules)
const allRuleIds = allRules.map(rule => rule.ruleId)
for (const rule of configRules) {
if (!allRuleIds.includes(rule)) {
console.warn(chalk.yellow(`[solhint] Warning: Rule '${rule}' doesn't exist`))
}
}

return enabledRules
}

Expand Down

0 comments on commit b80c320

Please sign in to comment.