Skip to content

[flow] broken code emitted for type annotation with empty type parameters when the value is an arrow function and arrow-parens: 'avoid' #13817

@bradzacher

Description

@bradzacher

Prettier 2.7.1
Playground link

--parser flow
--arrow-parens avoid
--trailing-comma all

Input:

const xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: xxxxxxxxxxxxxxxxxxxxxx<> =
  arg => null;

Output:

const xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: xxxxxxxxxxxxxxxxxxxxxx<
  ,
> = arg => null;

Expected behavior:

Not-broken code. I'd suggest probably:

const xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: xxxxxxxxxxxxxxxxxxxxxx<> =
  arg => null;

Metadata

Metadata

Assignees

Labels

lang:flowIssues affecting Flow-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions