mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
improvement(linter/nextjs): use root_node method in no_async_client_component rule. (#3087)
This commit is contained in:
parent
dcb2528861
commit
c49f6922c2
1 changed files with 2 additions and 2 deletions
|
|
@ -40,8 +40,8 @@ declare_oxc_lint!(
|
|||
|
||||
impl Rule for NoAsyncClientComponent {
|
||||
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!() };
|
||||
|
||||
if program.directives.iter().any(|directive| directive.directive.as_str() == "use client") {
|
||||
for node in &program.body {
|
||||
|
|
|
|||
Loading…
Reference in a new issue