Skip to content

Commit

Permalink
refactor(linter): rename Rule trait method params (#5617)
Browse files Browse the repository at this point in the history
Makes no real difference. Just produces nicer naming hints in IDEs.
  • Loading branch information
overlookmotel committed Sep 8, 2024
1 parent 4e748b5 commit afea8d5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/oxc_linter/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ pub trait Rule: Sized + Default + fmt::Debug {
}

/// Visit each AST Node
fn run<'a>(&self, _node: &AstNode<'a>, _ctx: &LintContext<'a>) {}
#[expect(unused_variables)]
fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {}

/// Visit each symbol
fn run_on_symbol(&self, _symbol_id: SymbolId, _ctx: &LintContext<'_>) {}
#[expect(unused_variables)]
fn run_on_symbol(&self, symbol_id: SymbolId, ctx: &LintContext<'_>) {}

/// Run only once. Useful for inspecting scopes and trivias etc.
fn run_once(&self, _ctx: &LintContext) {}
#[expect(unused_variables)]
fn run_once(&self, ctx: &LintContext) {}

/// Check if a rule should be run at all.
///
Expand All @@ -31,7 +34,8 @@ pub trait Rule: Sized + Default + fmt::Debug {
/// enabled/disabled; this is handled by the [`linter`].
///
/// [`linter`]: crate::Linter
fn should_run(&self, _ctx: &LintContext) -> bool {
#[expect(unused_variables)]
fn should_run(&self, ctx: &LintContext) -> bool {
true
}
}
Expand Down

0 comments on commit afea8d5

Please sign in to comment.