prettier-plugin-astro
prettier-plugin-astro copied to clipboard
🐛 BUG: `bracketSameLine` not working as expected in self-closing tags
Describe the Bug
With this prettier configuration:
.prettierrc:
{
"bracketSameLine": true,
"singleAttributePerLine": true,
"plugins": ["prettier-plugin-astro"]
}
In .astro files, I spect self-closing tags to be closed in the same line of its lasts attribute, but it closes in a new line.
unformated test.astro:
<input type="text" class="testing" />
formatted test.astro:
<input
type="text"
class="testing"
/>
In .html files it works as spected:
unformated test.html:
<input type="text" class="testing" />
formatted test.html:
<input
type="text"
class="testing" />
Steps to Reproduce
-
npm init astrousing template Empty -
npm i --save-dev prettier prettier-plugin-astro - Create in the root the .prettierrc with:
{
"bracketSameLine": true,
"singleAttributePerLine": true,
"plugins": ["prettier-plugin-astro"]
}
- Create in the pages folder the files test.astro and test.html files with the content:
<input type="text" class="testing" />
-
npx prettier --write . - Check the formatting results for both files are differents (it should be the same).