Skip to content

Recombine split JSX lines #1583

@karl

Description

@karl

With #1120 we now split JSX text across multiple lines when it gets too long to fit on a single line.

It would be nice to investigate whether we could automatically recombine split lines when they can fit on a single line (as mentioned in #1120 (comment)).

For example:

const Abc = () => {
  return (
    <div>
      Please state your
      {" "}
      <b>name</b>
      {" "}
      and
      {" "}
      <b>occupation</b>
      {" "}
      for the board of directors.
    </div>
  );
};

Would become:

const Abc = () => {
  return (
    <div>
      Please state your <b>name</b> and <b>occupation</b> for the board of
      directors.
    </div>
  );
}

Doing this would be a major change from our current JSX behaviour where we always retain newlines in the source. I've opened this issue to discuss whether we want to make this change and if so how we would like it to behave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions