prettier-plugin-blade
prettier-plugin-blade copied to clipboard
[Formatting Bug]: Incorrect formatting
Version
2.0.0
Template before formatting
<x-mail::message>
{{-- Subcopy --}}
@isset($actionText)
<x-slot:subcopy>
@lang(
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\n".
'into your web browser:',
[
'actionText' => $actionText,
]
)
<span class="break-all">[{{ $displayableActionUrl }}]({{ $actionUrl }})</span>
</x-slot:subcopy>
@endisset
</x-mail::message>
Template after formatting
<x-mail::message>
{{-- Subcopy --}}
@isset($actionText)
<x-slot:subcopy>
@lang(
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\n".
'into your web browser:',
[
'actionText' => $actionText,
]
)
<span class="break-all">[{{ $displayableActionUrl }}]({{ $actionUrl }})</span>
</x-slot>
@endisset
</x-mail::message>
Expected Behaviour
Tag x-slot:xxx should not be edited. When using ignore tags, the code is still refactored. Used in PHPStorm.
.prettierrc
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 240,
"tabWidth": 4,
"endOfLine": "lf",
"plugins": [
"prettier-plugin-antlers",
"prettier-plugin-blade",
"@prettier/plugin-php",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "**/*.php",
"options": {
"parser": "php",
"singleQuote": false,
"phpVersion": "8.2"
}
},
{
"files": "*.blade.php",
"options": {
"parser": "blade",
"singleQuote": false,
}
},
{
"files": [
"**/*.css",
"**/*.html"
],
"options": {
"singleQuote": false
}
}
]
}
Relevant log output
No response
Having the same issue. I know that technically the closing tag doesn't need the slot name. But PHPstorm complains that the tags don't match if it's missing. Using ignore tags to prevent this don't work for me either.
Having the same issue. I know that technically the closing tag doesn't need the slot name. But PHPstorm complains that the tags don't match if it's missing. Using ignore tags to prevent this don't work for me either.
When using <x-slot:subcopy>
it is advisable to close them in the same way. In my case the template for mail notifi was corrupted.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days