Skip to content

Commit

Permalink
fix(linter): eprintln unmatched rules warning (#6916)
Browse files Browse the repository at this point in the history
We can make this a hard error and bail early once stable.
  • Loading branch information
Boshen committed Oct 26, 2024
1 parent ce5b609 commit cb5cb62
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/oxc_linter/src/config/rules.rs
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ impl IntoIterator for OxlintRules {
}

impl OxlintRules {
#[allow(clippy::option_if_let_else, clippy::print_stdout)]
#[allow(clippy::option_if_let_else, clippy::print_stderr)]
pub(crate) fn override_rules(&self, rules_for_override: &mut RuleSet, all_rules: &[RuleEnum]) {
use itertools::Itertools;
let mut rules_to_replace: Vec<RuleWithSeverity> = vec![];
@@ -134,10 +134,11 @@ impl OxlintRules {
}

if !rules_not_matched.is_empty() {
println!("The following rules do not match the currently supported rules:");
for rule in rules_not_matched {
println!("{rule}");
}
let rules = rules_not_matched.join("\n");
let error = Error::from(OxcDiagnostic::warn(format!(
"The following rules do not match the currently supported rules:\n{rules}"
)));
eprintln!("{error:?}");
}
}
}

0 comments on commit cb5cb62

Please sign in to comment.