Skip to content

jsx-wrap-multilines option for always newlining  #1328

Closed
@planttheidea

Description

@planttheidea

There are a few other issues related to this concept, where the autofix for jsx-wrap-multilines results in something like this:

return (<div>
  foo
</div>);

This happens in specific scenarios (when there is no indentation set), but this always happens with multiline self-closing tags:

return (<SomeChildlessComponent
  foo="foo"
  bar="bar"
/>);

It would be really handy if there was an option added to jsx-wrap-multiline that always newlined the wrapped output on autofix, so that tag alignment was maintained:

return (
  <SomeChildlessComponent
    foo="foo"
    bar="bar"
  />
);

Since the whole point is that wrapping the element enhances readability, this option would help greatly.

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