Skip to content

Commit

Permalink
refactor(linter): remove unnecessary check in `eslint/no-global-assig…
Browse files Browse the repository at this point in the history
…n` (#3391)

Looks like we don't need check this, as unresolved references don't have `symbolId`: https://github.com/oxc-project/oxc/blob/bb25c54b94ff778e3598bb0f528d43a0c78333a0/crates/oxc_semantic/src/builder.rs#L292-L303
  • Loading branch information
mysteryven committed May 24, 2024
1 parent b8997f5 commit d8c3187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/eslint/no_global_assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Rule for NoGlobalAssign {
for reference_id_list in ctx.scopes().root_unresolved_references().values() {
for &reference_id in reference_id_list {
let reference = symbol_table.get_reference(reference_id);
if reference.is_write() && symbol_table.is_global_reference(reference_id) {
if reference.is_write() {
let name = reference.name();
if !self.excludes.contains(name) && ctx.env_contains_var(name) {
ctx.diagnostic(no_global_assign_diagnostic(name, reference.span()));
Expand Down

0 comments on commit d8c3187

Please sign in to comment.