You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script>
let a = "@lang('global.resend_available_in')";
var b = 60;
</script>
===================
Expected Behavior
Inline JavaScript inside Blade templates should remain correctly formatted.
Blade directives should not be broken or reformatted incorrectly.
The trailingComma rule should apply consistently across Blade files.
Actual Behavior
Prettier introduces syntax-breaking changes to inline JavaScript.
Some Blade directives get incorrectly modified or removed.
Prettier and ESLint conflict, leading to unwanted formatting changes.
The text was updated successfully, but these errors were encountered:
When using
prettier-plugin-blade
to format Blade templates (.blade.php
files), the following issues occur:JavaScript inside Blade templates gets incorrectly formatted
@lang()
) gets broken.Trailing commas and indentation issues
"trailingComma": "all"
setting.@foreach
,@if
, and@section
structures sometimes gets inconsistent.Prettier conflicts with ESLint in Blade files
eslint --fix
on Blade templates causes additional unintended formatting.eslint-plugin-html
does not recognize Blade directives, leading to parsing errors.================
.prettierrc.json
{
"trailingComma": "all",
"singleQuote": true,
"semi": true,
"tabWidth": 4,
"plugins": ["prettier-plugin-blade"],
"overrides": [
{
"files": "*.blade.php",
"options": {
"parser": "blade"
}
}
]
}
Sample blade -
<script> let a = "@lang('global.resend_available_in')"; var b = 60; </script>===================
Expected Behavior
Inline JavaScript inside Blade templates should remain correctly formatted.
Blade directives should not be broken or reformatted incorrectly.
The trailingComma rule should apply consistently across Blade files.
Actual Behavior
Prettier introduces syntax-breaking changes to inline JavaScript.
Some Blade directives get incorrectly modified or removed.
Prettier and ESLint conflict, leading to unwanted formatting changes.
The text was updated successfully, but these errors were encountered: