Skip to content

Commit

Permalink
feat(semantic): move redeclare varaibles to symbol table
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Mar 7, 2024
1 parent b2de57a commit cc7a5ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/oxc_linter/src/rules/eslint/no_redeclare.rs
Expand Up @@ -109,8 +109,12 @@ impl NoRedeclare {
ident.name.to_compact_str(),
ident.span,
));
} else {
ctx.diagnostic(NoRedeclareDiagnostic(ident.name.to_compact_str(), ident.span, span));
} else if variable.span != ident.span {
ctx.diagnostic(NoRedeclareDiagnostic(
ident.name.to_compact_string(),
ident.span,
variable.span,
));
}
}
}
Expand Down

0 comments on commit cc7a5ad

Please sign in to comment.