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

Bug: [no-unused-vars] Used vars incorrectly reported in presence of static blocks #5577

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@gebsh

Description

@gebsh

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.

Playground Link

Playground does not work

Repro Code

functionfoo(){}exportclassFoo{static{}constructor(){foo();}}

ESLint Config

module.exports={parser:'@typescript-eslint/parser',plugins:['@typescript-eslint/eslint-plugin'],rules:{'@typescript-eslint/no-unused-vars':'warn',},};

tsconfig

No response

Expected Result

No report about unused variables.

Actual Result

Thefoo function is reported as unused even though it's used by theFoo class.

Additional Info

Removing the static block fromFoo removes the report.

Initially, I thought that this may be related to#5571, but this issue still persists after upgrading to 5.36.1.

Versions

packageversion
@typescript-eslint/eslint-plugin5.36.1
@typescript-eslint/parser5.36.1
TypeScript4.8.2
ESLint8.23.0
node18.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    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