Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/oxc_linter/src/config/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
9 changes: 7 additions & 2 deletions crates/oxc_linter/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<FxHashSet<&str>>();

Expand Down Expand Up @@ -94,7 +99,7 @@ impl RuleTable {
})
.collect::<Vec<_>>();

RuleTable { total, sections, turned_on_by_default_count: 123 }
RuleTable { total, sections, turned_on_by_default_count: default_rules.len() }
}
}

Expand Down
Loading