Skip to content

Jsx force multiline attributes #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: logicsoftware
Choose a base branch
from

Conversation

denisborovnev
Copy link
Collaborator

@denisborovnev denisborovnev commented Sep 24, 2021

allow forcing multiline jsx attributes (if first attribute is moved to the new line then save multiline mode)

example

<MyComponent 
    a1={1} a2={2}
/>

will be formatted as

<MyComponent
   a1={1}
   a2={2]
/>   

but

<MyComponent a1={1} a2={2} />

// or

<MyComponent a1={1} 
     a2={2} />

will be formatted as (if there is enough space by print-width option)

<MyComponent a1={1} a2={2} />   

if somebody typed first attribute on the new line then print all the attributes
on the new line.

otherwise left all the atributes on the single line if there is enough space
@denisborovnev denisborovnev changed the title Jsx force new line attributes Jsx force multiline attributes Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant