diff --git a/crates/oxc_linter/src/config/plugins.rs b/crates/oxc_linter/src/config/plugins.rs index a04ed62805195..9ac557b703c2c 100644 --- a/crates/oxc_linter/src/config/plugins.rs +++ b/crates/oxc_linter/src/config/plugins.rs @@ -53,6 +53,7 @@ bitflags! { impl Default for BuiltinLintPlugins { #[inline] fn default() -> Self { + // update `oxc_linter::table::RuleTable` when changing the defaults BuiltinLintPlugins::UNICORN | BuiltinLintPlugins::TYPESCRIPT | BuiltinLintPlugins::OXC } } diff --git a/crates/oxc_linter/src/table.rs b/crates/oxc_linter/src/table.rs index 0bdc6fa0d4395..1c617424f37c2 100644 --- a/crates/oxc_linter/src/table.rs +++ b/crates/oxc_linter/src/table.rs @@ -40,9 +40,14 @@ impl RuleTable { #[expect(clippy::allow_attributes)] #[allow(unused, unused_mut)] pub fn new(mut generator: Option<&mut schemars::SchemaGenerator>) -> Self { + let default_plugin_names = ["eslint", "unicorn", "typescript", "oxc"]; + let default_rules = RULES .iter() - .filter(|rule| rule.category() == RuleCategory::Correctness) + .filter(|rule| { + rule.category() == RuleCategory::Correctness + && default_plugin_names.contains(&rule.plugin_name()) + }) .map(super::rules::RuleEnum::name) .collect::>(); @@ -94,7 +99,7 @@ impl RuleTable { }) .collect::>(); - RuleTable { total, sections, turned_on_by_default_count: 123 } + RuleTable { total, sections, turned_on_by_default_count: default_rules.len() } } }