Skip to content

After upgrading to v1.14.0 formatted by prettier code in some cases looks ugly #4941

@yuliaHope

Description

@yuliaHope

Prettier 1.14.0
Playground link

# Options (if any):
--parser babylon
--print-width 1000

Input:

x = <div>Sales tax estimated using a rate of {salesTax * 100}%.</div>

x = <div>
  {title}&nbsp;
</div>

Output:

x = (
  <div>
    Sales tax estimated using a rate of {salesTax * 100}
    %.
  </div>
);

x = (
  <div>
    {title}
    &nbsp;
  </div>
);

Expected behavior:
Don't split this jsx text and don't move it to new line.

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