Skip to content

Commit

Permalink
Handle rule that is disabled at the top level config
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Jul 21, 2021
1 parent 8dcd944 commit ea81eba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ function lint(flowobj, config) {
// console.log(startTime,"start lint")
// Check each rule in the configuration
Object.keys(config.rules).forEach(function(ruleName) {

// Get the rule implementation
let rule = resolveRule(ruleName);

if (!rule) {
if (!rule || config.rules[ruleName] === "off") {
// Not a rule we know about, or rule disabled ("off")
return
}
Expand Down

0 comments on commit ea81eba

Please sign in to comment.