I love how dprint handles the formatting in JSX with the component's props, for example
const Component = () => {
return (
<Badge color="red" size="xs">
{"@" + username}
</Badge>
)
}
This code formats to this: (the same)
const Component = () => {
return (
<Badge color="red" size="xs">
{"@" + username}
</Badge>
)
}
And this code:
const Component = () => {
return (
<Badge
color="red"
size={25}
>
{"@" + username}
</Badge>
);
};
to this (also the same)
const Component = () => {
return (
<Badge
color="red"
size={25}
>
{"@" + username}
</Badge>
);
};
When you have 2 props, you can select use a new line on every prop, or put it in the same line, this avoid this ugly prettier problem:
Input
<div>
<Card name="John Doe" age={25} imageUrl="myImageHost.com/x"/>
<Card name="John Doe" age={25} imageUrl="myImageHost.com/x1242141245939519659"/>
</div>
Output
<div>
<Card name="John Doe" age={25} imageUrl="myImageHost.com/x" />
<Card
name="John Doe"
age={25}
imageUrl="myImageHost.com/x1242141245939519659"
/>
</div>;
With no option of be like this:
<div>
<Card
name="John Doe"
age={25}
imageUrl="myImageHost.com/x"
/>
<Card
name="John Doe"
age={25}
imageUrl="myImageHost.com/x1242141245939519659"
/>
</div>;
This plugin has the same problem, and I would like to have an option like mantain the user selection of new lines in props. Thank you for this awesome plugin! I like to use it with Astro