Skip to content

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Sep 15, 2025

Prerequisites checklist

What is the purpose of this pull request?

Updates eslint-scope to resolve references to globally declared var and function variables, and adds a method to create predefined global variables.

What changes did you make? (Give an overview)

  • Updated global scope to resolve references to declared var and function variables.
  • Added ScopeManager#addGlobals() method that allows adding predefined globals.

Related Issues

Fixes #665

Is there anything you'd like reviewers to focus on?

It would probably be more elegant to pass a list of predefined globals in advance, as an option to analyze. But that doesn't fit the use of eslint-scope and other scope managers in ESLint, where the scope is analyzed in the parse step, whereas globals are added in SourceCode#finalize().

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Sep 15, 2025
@mdjermanovic mdjermanovic changed the title feat!: Close var and function references on global scope feat!: Resolve references to global var/function, add addGlobals() Sep 16, 2025
@mdjermanovic mdjermanovic moved this from Needs Triage to Blocked in Triage Sep 23, 2025
@mdjermanovic
Copy link
Member Author

This is ready for review. Related PR in eslint/eslint is eslint/eslint#20132.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

Successfully merging this pull request may close these issues.

Question: how come function references on the global scope are not closed
1 participant