-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
scope-manager
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
ESLint v10.0.0 will introduce two breaking changes for custom ScopeManager implementations:
- It is expected that all references to global variables declared in code, including
varandfunctiondeclarations, have already been resolved. Previously, ESLint was resolving unresolved references. ScopeManagershould provide an instance methodaddGlobals(names: string[])that creates variables with the given names in the global scope and resolves references to them.
The proposal is to implement these changes in @typescript-eslint/scope-manager, for compatibility with ESLint v10.
Additional Info
eslint v10.0.0-alpha.0 already expects these changes and can be used for testing.
eslint-scope v9.0.0 already implements these changes.
Relevant links:
- ESLint v10 Migration Guide: https://eslint.org/docs/next/use/migrate-to-10.0.0#scope-manager
- ESLint v10
parseForESLintReturn Object specification: https://eslint.org/docs/next/extend/custom-parsers#parseforeslint-return-object. - ESLint v10.0.0-alpha.0 release notes: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#new-requirements-for-scopemanager-implementations.
- Original issue: Question: how come function references on the global scope are not closed eslint/js#665
eslint-scopeupdate: feat!: Resolve references to globalvar/function, addaddGlobals()eslint/js#682eslintupdate: feat!: UseScopeManager#addGlobals()eslint/eslint#20132
JoshuaKGoldberg, kachkaev, silverwind, brettz9 and lumirlumir
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager