From 876a2948105817e5ebc09a36093cb4b431d0269a Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Mon, 29 Dec 2025 20:32:51 -0700 Subject: [PATCH 1/2] feat(website_linter): Add a count of rules with fixes available to rules table. --- crates/oxc_linter/src/table.rs | 11 ++++++++++- tasks/website_linter/src/rules/table.rs | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/oxc_linter/src/table.rs b/crates/oxc_linter/src/table.rs index d79258f4f88fb..0dc10838d52eb 100644 --- a/crates/oxc_linter/src/table.rs +++ b/crates/oxc_linter/src/table.rs @@ -8,6 +8,7 @@ pub struct RuleTable { pub sections: Vec, pub total: usize, pub turned_on_by_default_count: usize, + pub rules_with_fixes: usize, } pub struct RuleTableSection { @@ -17,6 +18,7 @@ pub struct RuleTableSection { pub plugin_column_width: usize, } +#[derive(Debug, Clone)] pub struct RuleTableRow { pub name: &'static str, pub plugin: String, @@ -75,6 +77,8 @@ impl RuleTable { rows.sort_by_key(|row| (row.plugin.clone(), row.name)); + let rules_with_fixes = rows.iter().filter(|r| r.autofix.has_fix()).count(); + let mut rows_by_category = rows.into_iter().fold( FxHashMap::default(), |mut map: FxHashMap>, row| { @@ -101,7 +105,12 @@ impl RuleTable { }) .collect::>(); - RuleTable { total, sections, turned_on_by_default_count: default_rules.len() } + RuleTable { + total, + sections, + turned_on_by_default_count: default_rules.len(), + rules_with_fixes, + } } } diff --git a/tasks/website_linter/src/rules/table.rs b/tasks/website_linter/src/rules/table.rs index ba5cec35ce423..788d99b56945b 100644 --- a/tasks/website_linter/src/rules/table.rs +++ b/tasks/website_linter/src/rules/table.rs @@ -10,7 +10,7 @@ use oxc_linter::table::RuleTable; pub fn render_rules_table(table: &RuleTable, docs_prefix: &str) -> String { let total = table.total; let turned_on_by_default_count = table.turned_on_by_default_count; - + let rules_with_fixes = table.rules_with_fixes; let body = table .sections .iter() @@ -28,6 +28,7 @@ The progress of all rule implementations is tracked [here](https://github.com/ox - Total number of rules: {total} - Rules turned on by default: {turned_on_by_default_count} +- Rules with fixes available: {rules_with_fixes} **Legend for 'Fixable?' column:** - 🛠️: an auto-fix is available for this rule From 73b0f3233ccd22780036d88bd29b3f0feab18433 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Mon, 29 Dec 2025 20:40:23 -0700 Subject: [PATCH 2/2] Update crates/oxc_linter/src/table.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Connor Shea --- crates/oxc_linter/src/table.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/oxc_linter/src/table.rs b/crates/oxc_linter/src/table.rs index 0dc10838d52eb..744bdd30060e8 100644 --- a/crates/oxc_linter/src/table.rs +++ b/crates/oxc_linter/src/table.rs @@ -18,7 +18,6 @@ pub struct RuleTableSection { pub plugin_column_width: usize, } -#[derive(Debug, Clone)] pub struct RuleTableRow { pub name: &'static str, pub plugin: String,