Skip to content

Incorrect parsing breaks prettier #194

@vwong

Description

@vwong

Version: 5.7.0 - 5.7.2

Starting with 5.7.0, this component

static const compare = (a: number, b: number): string => {
  if (a < b) {
    return "smaller";
  } else {
    return "larger";
  }
};

now gives an error with prettier:

[error]     > 1 | static const compare = (a: number, b: number): string => {
[error]         |       ^ Mismatched group. A ")" character was found when ">" was expected.
[error]       2 |   if (a < b) {
[error]       3 |     return "abc";
[error]       4 |   } else {

It was fine in 5.6.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions