Skip to content

Commit

Permalink
refactor(linter): remove unused with_rules and set_rule methods (#…
Browse files Browse the repository at this point in the history
…8029)

this method is unused, hence it makes sense to remove.
furthermore, keeping it makes it tricky to work the nested config stuff
  • Loading branch information
camc314 committed Dec 19, 2024
1 parent 6344b93 commit b2a4a78
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions crates/oxc_linter/src/config/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ impl ConfigStore {
Self { cache, base, overrides }
}

/// Set the base rules, replacing all existing rules.
#[cfg(test)]
#[inline]
pub fn set_rules(&mut self, new_rules: Vec<RuleWithSeverity>) {
self.base.rules = Arc::from(new_rules.into_boxed_slice());
}

pub fn number_of_rules(&self) -> usize {
self.base.rules.len()
}
Expand Down
7 changes: 0 additions & 7 deletions crates/oxc_linter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ impl Linter {
Self { options, config }
}

#[cfg(test)]
#[must_use]
pub fn with_rules(mut self, rules: Vec<RuleWithSeverity>) -> Self {
self.config.set_rules(rules);
self
}

/// Set the kind of auto fixes to apply.
///
/// # Example
Expand Down

0 comments on commit b2a4a78

Please sign in to comment.