With PHP formatting enabled, certain :attribute="..." bindings become invalid after formatting.
For example:
<x-ui.image :src="$article['image']" />
<x-div :title="__('Hello')"></x-div>
After formatting:
<x-ui.image :src="$article["image"]" />
<x-div :title="__("Hello")"></x-div>
Using the following config:
"plugins": [
"prettier-plugin-blade",
"prettier-plugin-tailwindcss",
"@prettier/plugin-php"
],
"overrides": [
{
"files": [
"*.blade.php"
],
"options": {
"parser": "blade",
"bladePhpFormatting": "safe",
"bladePhpFormattingTargets": [
"directiveArgs",
"echo",
"phpBlock"
],
"bladeKeepHeadAndBodyAtRoot": false
}
}
]
If I add "singleQuote": true, both examples format correctly, so this seems to be triggered specifically by "singleQuote": false inside bound Blade attributes.
With PHP formatting enabled, certain
:attribute="..."bindings become invalid after formatting.For example:
After formatting:
Using the following config:
If I add
"singleQuote": true, both examples format correctly, so this seems to be triggered specifically by"singleQuote": falseinside bound Blade attributes.