Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Feb 27, 2025
1 parent 8c93700 commit 1da6694
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/swc_ecma_lints/src/rules/no_use_before_define.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,18 @@ impl NoUseBeforeDefine {
Pat::Ident(id) => {
self.check_ident(es6_var_check, &Ident::from(id));
}
Pat::Array(ArrayPat { elems, .. }) => {
Pat::Array(arr) => {
let ArrayPat { elems, .. } = &**arr;

elems.iter().for_each(|elem| {
if let Some(elem) = elem {
self.check_pat(es6_var_check, elem);
}
});
}
Pat::Object(ObjectPat { props, .. }) => {
Pat::Object(obj) => {
let ObjectPat { props, .. } = &**obj;

props.iter().for_each(|prop| match prop {
ObjectPatProp::Assign(AssignPatProp { key, .. }) => {
self.check_ident(es6_var_check, &Ident::from(key));
Expand Down

0 comments on commit 1da6694

Please sign in to comment.