Skip to content

Regression: trailing char is moved to the next line as leading char #5336

@ikatyang

Description

@ikatyang

Prettier pr-5006
Playground link

--parser babylon

Input:

let myDiv = ReactTestUtils.renderIntoDocument(
  <div>
    <div key="theDog" className="dog" />,
    <div key="theBird" className="bird" />
  </div>
);

Output:

let myDiv = ReactTestUtils.renderIntoDocument(
  <div>
    <div key="theDog" className="dog" />
    ,<div key="theBird" className="bird" />
  </div>
);

Expected behavior:
Same as input.

Regression from #5006, cc @yuliaHope @lydell.

(Similar to #5047 but this one is fine in 1.14.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:jsxIssues affecting JSX (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