Skip to content

Commit

Permalink
fix reference
Browse files Browse the repository at this point in the history
  • Loading branch information
azihsoyn committed Nov 2, 2024
1 parent 90edd36 commit ac35515
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/oxc_linter/src/rules/eslint/no_array_constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use oxc_ast::ast::Expression;
use oxc_ast::AstKind;
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_semantic::IsGlobalReference;
use oxc_span::Span;

use crate::{context::LintContext, rule::Rule, AstNode};
Expand Down Expand Up @@ -68,7 +69,11 @@ impl Rule for NoArrayConstructor {
}
};

if callee.is_global_reference_name("Array", ctx.symbols())
let Expression::Identifier(ident) = &callee else {
return;
};

if ident.is_global_reference_name("Array", ctx.symbols())
&& arguments.len() != 1
&& type_parameters.is_none()
&& !optional
Expand Down

0 comments on commit ac35515

Please sign in to comment.