Skip to content

Unused locals in class static block declarations are not reportedΒ #64484

Description

πŸ”Ž Search Terms

unused locals class lint static block declaration

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?noUnusedLocals=true&isolatedDeclarations=false#code/PTAEAEDsHsFVIK4GcCmATAMtAxgQwDZIBcoALgE4IoBQ12+uSSoAwgIygDe1ooSpuUgEtsXHr1D4UpUADNo0UAF5QbANziAvtW3VZCSNmHRIctgAoAlGN5SZAI1zlloAEwbtQA

πŸ’» Code

// @noUnusedLocals: true

class C1 {
  static {
    let foo = 1;
  }
}

πŸ™ Actual behavior

The error is not reported

πŸ™‚ Expected behavior

It should report:

error TS6133: 'foo' is declared but its value is never read.

Additional information about the issue

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions