diff --git a/crates/ruff/src/checkers/ast/mod.rs b/crates/ruff/src/checkers/ast/mod.rs index 8cc0d8b04705b..907f4904ccaf7 100644 --- a/crates/ruff/src/checkers/ast/mod.rs +++ b/crates/ruff/src/checkers/ast/mod.rs @@ -4971,7 +4971,9 @@ impl<'a> Checker<'a> { if let Some(diagnostic) = flake8_type_checking::rules::runtime_import_in_type_checking_block(binding) { - diagnostics.push(diagnostic); + if self.settings.rules.enabled(diagnostic.kind.rule()) { + diagnostics.push(diagnostic); + } } if let Some(diagnostic) = flake8_type_checking::rules::typing_only_runtime_import(