Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lint/correctness/noUnusedVariables falsePositive for multiple new overloads with generic parameters #8435

@GiuseppeIII

Description

@GiuseppeIII

Environment information

...

Rule name

lint/correctness/noUnusedVariables

Playground link

https://biomejs.dev/playground/?attributePosition=multiline&code=dAB5AHAAZQAgAFQAZQBzAHQAIAA9ACAAewAKAAkAbgBlAHcAIAA8AFQAPgAoACkAOgAgAFQAOwAKAAkAbgBlAHcAIAA8AFQAPgAoAHsAIAB0AGUAcwB0ADoAIABUACAAfQApADoAIABUADsACgB9AA%3D%3D

Expected result

type Test = {
	new <T>(): T;
	new <T>({ test: T }): T;
}

Currently gives This type parameter T is unused. one the first new line.
As the generic parameter is used there, I would expect it to work correctly.
(Note: identical overloads without the new keyword work fine

type Test = {
  	<T>(): T;
	<T>({ test: T }): T;
}

gives no issue
)

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions