mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
improvement(linter/tree_shaking): use root_node in the no_side_effects_in_initialization rule. (#3089)
This commit is contained in:
parent
69e464b19a
commit
71da1a1d72
1 changed files with 2 additions and 2 deletions
|
|
@ -86,8 +86,8 @@ declare_oxc_lint!(
|
|||
|
||||
impl Rule for NoSideEffectsInInitialization {
|
||||
fn run_once(&self, ctx: &LintContext) {
|
||||
let Some(root) = ctx.nodes().iter().next() else { return };
|
||||
let AstKind::Program(program) = root.kind() else { return };
|
||||
let Some(root) = ctx.nodes().root_node() else { return };
|
||||
let AstKind::Program(program) = root.kind() else { unreachable!() };
|
||||
let node_listener_options = NodeListenerOptions::new(ctx);
|
||||
program.report_effects(&node_listener_options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue