Skip to content

Commit cc1267e

Browse files
committedApr 4, 2025·
fix(linter): fix Display impl for ConfigBuilderError (#10239)
If multiple rules, previously their names would be concatenated without any delimiters in between. Add `, ` between the rule names.
1 parent 08a0d5e commit cc1267e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎crates/oxc_linter/src/config/config_builder.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,12 @@ impl Display for ConfigBuilderError {
394394
match self {
395395
ConfigBuilderError::UnknownRules { rules } => {
396396
f.write_str("unknown rules: ")?;
397-
for rule in rules {
398-
Display::fmt(&rule.full_name(), f)?;
397+
for (i, rule) in rules.iter().enumerate() {
398+
if i == 0 {
399+
Display::fmt(&rule.full_name(), f)?;
400+
} else {
401+
write!(f, ", {}", rule.full_name())?;
402+
}
399403
}
400404
Ok(())
401405
}

0 commit comments

Comments
 (0)
Please sign in to comment.