Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Scope Manager fails to pick up references to implicit globals #11714

Open
Labels
awaiting responseIssues waiting for a reply from the OP or another partybugSomething isn't working
@lilnasy

Description

@lilnasy

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Relevant Package

scope-manager

Playground Link

No response

Repro Code

undefined;globalThis;NaN;Object;Boolean;String;Math;Date;Array;Map;Set;varfoo;foo;

ESLint Config

Notrelevant

tsconfig

{"compilerOptions": {"lib": ["esnext"]  }}

Expected Result

All identifiers butfoo are analyzed to be determined references to implicit global variables.

Actual Result

OnlyString andObject are determined to be references to implicit global variables.

Additional Info

What's going wrong?

  • The generated code for ts libs may include multiple mentions of the same variable, in some cases indicating the variable is aTYPE, andTYPE_VALUE in others.
  • WhenReferencer.populateGlobalsFromLib callsGlobalScope.defineImplicitVariable which callsScopeBase.defineVariable and the variable is already defined, it doesn't entertain the possibility that the variable may have different type/value attributes and simply moves on.
  • The result:@typescript-eslint/scope-manager incorrectly indicates to the user project that a variable is a type, and the scope analysis does not pick up value identifiers as references to the variable.

Versions

packageversion
@typescript-eslint/scope-manager8.46.1'
TypeScript5.9.3
node24.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseIssues waiting for a reply from the OP or another partybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp