From ea81ebaf04b0bd1c5bfd7d08b31b0d14812004ff Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 21 Jul 2021 11:58:32 +0100 Subject: [PATCH] Handle rule that is disabled at the top level config --- lib/linter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/linter.js b/lib/linter.js index 3bdfc87..01dadd6 100644 --- a/lib/linter.js +++ b/lib/linter.js @@ -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 }