Skip to content

Bug: [scope-manager] Static Blocks do not introduce a scope #5485

Closed
@DMartens

Description

@DMartens

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 have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Relevant Package

scope-manager

Playground Link

https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&showAST=scope&code=MYGwhgzhAEDC5WgbwFDWhALmTBLYy0AviiUA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

class Class {
    static {}
}

ESLint Config

No response

tsconfig

No response

Expected Result

I expected the static block to have its own scope but no scope is introduced.

Actual Result

There is no scope for the static block, but eslint-scope adds a scope (relevant PR).

Additional Info

A class for static blocks exists but the ClassVisitor does not reference it.

Versions

package version
@typescript-eslint/scope-manager 5.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions