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

Skip to content

Enhancement: Forbid empty type argument list #11561

@fisker

Description

@fisker

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

f1<>();

new f2<>();

function f3<>() { }

class f4 {
  constructor<>() { }
}

const f5 = function <>() { }

interface f6<> {
  test<>();
}

class f7<> {
  test<>() { }
}

should be invalid.

Additional Info

Tests copied from Prettier repo https://github.com/prettier/prettier/blob/08f687d4b2a3a789ae93226025915c1b272b8b8c/tests/format/typescript/error-recovery/generic.ts#L1C1-L19C2

Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions