Skip to content

💅 useExpect false positive with expect-type's type testing expectTypeOf #9168

@Bertie690

Description

@Bertie690

Environment information

Details
N/A

Rule name

lint/nursery/useExpect

Playground link

https://biomejs.dev/playground/?lintRules=useExpect&code=aQBtAHAAbwByAHQAIAB7ACAAZABlAHMAYwByAGkAYgBlACwAIABlAHgAcABlAGMAdABUAHkAcABlAE8AZgAsACAAaQB0ACAAfQAgAGYAcgBvAG0AIAAiAHYAaQB0AGUAcwB0ACIAOwAKAAoAaQB0ACgAIgB0AGUAcwB0ACIALAAgACgAKQAgAD0APgAgAHsACgAgACAAZQB4AHAAZQBjAHQAVAB5AHAAZQBPAGYAPAAxAD4AKAApAC4AbgBvAHQALgB0AG8ARQBxAHUAYQBsAFQAeQBwAGUATwBmACgAMgApADsACgB9ACkAOwAKAA%3D%3D

Expected result

It should not error, as expectTypeOf (which vitest re-exports from expect-type) is an assertion (albeit not a runtime one).

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    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