diete-design / diete.design

https://diete.design
MIT License
0 stars 0 forks source link

Change formatting of HTML elements to always have `>` on the same line as `<` #130

Open vojtechsimetka opened 2 weeks ago

vojtechsimetka commented 2 weeks ago

The auto formatting is a bit annoying where it sometimes puts the > on next line. E.g.

<Button {dimension} {disabled} variant="secondary" onclick={() => (inputValue += 1)}
    ><Add size={dimension === 'small' ? 16 : 24} /></Button
>

instead the code should be formatted like this

<Button {dimension} {disabled} variant="secondary" onclick={() => (inputValue += 1)}>
    <Add size={dimension === 'small' ? 16 : 24} />
</Button>

Or if the attributes are too long like this

<Button 
    {dimension}
    {disabled}
    variant="secondary"
    onclick={() => (inputValue += 1)}>
    <Add size={dimension === 'small' ? 16 : 24} />
</Button>
vvu11 commented 2 weeks ago

can i ask what editor you are using it

agazso commented 2 weeks ago

can i ask what editor you are using it

The project uses Prettier to format the source files. Here is the current configuration: https://github.com/diete-design/diete.design/blob/main/.prettierrc