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-deprecated] Forbids using the name of a deprecated class member in a child classes constructor #11394

Open
Labels
bugSomething isn't workingexternalThis issue is with another package, not typescript-eslint itselfpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@TheBlue-1

Description

@TheBlue-1

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

https://typescript-eslint.io/play/#ts=5.8.2&fileType=.tsx&code=LAKApgHgDg9gTgFwAQGMA2BDAzlpAFDOMAOwQGFMckBvUJJAegComkABAEzCiJQwTAckTBnSRQArgCM0ASxRIAboVkYZYAFxIsCOLOIBzJAB8kE4lwBm%2BwQG5QYyTPlJiYAO4A1FWrSbtuvpGpuZWNhz2II7ScgooMMQ6cBIoCPAAFMp6vv5JQQCUNGL0CAAWslgAdG5ePupIALxKdX6R9AC%2BoJ1R4NDwyOjYuGTlaBwUQ0iQAha4BESkE1S0IPROsaijHN7Z6lp5hiZmFmDWbhHRznEJSSlpcJktuYGGhSv09FgSUGAPWarqfJtD5lCqVFBbHYAvyNZq7VpibrdIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oBNFjpEZAIb5E3dFETRoHaJHBgAviEVA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

exportclassParentClass{/**@deprecated */publicvariable:string|undefined;publicnewVariable:string|undefined;publicconstructor(variable:string){this.newVariable=variable;}}exportclassChildClassextendsParentClass{publicchildVariable:string|undefined;publicconstructor(variable:string){super(variable);// reports usage of deprecated member "varaible"this.childVariable=variable;// reports usage of deprecated member "varaible"}}

ESLint Config

module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/no-deprecated":"error"},};

tsconfig

{"compilerOptions": {"strictNullChecks":true  }}

Expected Result

I expect to be allowed to reuse the name of a deprecated member of my parent class in my child classes constructor, because it doesnt use the this keyword likethis.variable.

Actual Result

The usage of my funcrtion scope variable gets forbidden by the rule.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexternalThis issue is with another package, not typescript-eslint itselfpackage: 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