Skip to content

Removing necessary member expression parenthesis for new #2033

@jamiebuilds

Description

@jamiebuilds

Prettier 1.4.2 is doing this:

  function createObj() {
    return { prop: class {} };
  }

- new (createObj()).prop();
+ new createObj().prop();

This changes the behavior of the code from:

let obj = createObj();
new obj.prop();

To:

let obj = new createObj();
obj.prop();

[Demo]

Metadata

Metadata

Assignees

No one assigned

    Labels

    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!

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions