Will not format classes within Blade files.
See original GitHub issueI’m using VS Code and I have everything installed as required, format on save
is on.
When I save, I get an error on the bottom that says Extension 'Prettier - code formatter' is configured as formatter but can not format 'Blade' files.
I have this in my .prettierrc as noted in another issue, but it’s not affecting anything:
{
"overrides": [
{
"files": "*.blade.php",
"options": {
"parser": "html"
}
}
]
}
If I run npx prettier --check resources/views
it states everything is formatted properly (which it’s not)
Interestingly, if I change a blade file to be a plain HTML file,format on save
still does not do anything, but running npx prettier
will then find the issues.
What am I doing wrong?
Is there no support for the formatter in blade files within a Laravel project?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to Format Laravel Blade Code in Visual Studio Code?
First go to "Visual Studio Code" Settings and search for the option "files.associations" If that option is not available in your settings.
Read more >Laravel Blade formatter - Visual Studio Marketplace
Extension for Visual Studio Code - Laravel Blade formatter for VSCode. ... To disable formatting in your file, you can use blade comments...
Read more >Some <span> tags are not properly formatted inside HTML ...
Some <span> tags are not properly formatted inside HTML and Blade files ; State, Declined ; Assignee, Rustam Vishniakov ; Subsystem, PHP Formatter...
Read more >shufo/blade-formatter - GitHub
This project aims to provide formatter for blade template because there is no official blade template formatter. Try it out on Online Demo....
Read more >Blade Templates - The PHP Framework For Web Artisans
Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates. In fact, all Blade templates...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nwlr My main goal is to just sort the Tailwind classes within a Blade file. You’re saying installing your plugin and setting the blade parser to HTML makes it pick up the Tailwind classes using the tailwindcss-prettier plugin?
There’s a blade plugin which works really well prettier-plugin-blade