Skip to content

TypeScript generics are removed incorrectly #5817

@JounQin

Description

@JounQin

Prettier 1.16.2
Playground link

--parser typescript

Input:

export default {
  load<K, T>(k: K, t: T) {
  	return {k, t};
  }
}

Output:

export default {
  load(k: K, t: T) {
    return { k, t };
  }
};

Expected behavior:
preserve TypeScript generics

Metadata

Metadata

Assignees

Labels

lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions