snaha / 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 6 months ago

vojtechsimetka commented 6 months 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 6 months ago

can i ask what editor you are using it

agazso commented 6 months 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