Open devinvb opened 7 months ago
Hi,
I'm running into a problem with formatting blade directives (space after), when using config "useLaravelPint": true,. If I run prettier on a single file it works, but if I run it for an entire folder it doesn't.
"useLaravelPint": true,
My .prettierrc config
{ "singleQuote": true, "printWidth": 120, "tabWidth": 4, "plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"], "overrides": [ { "files": ["*.blade.php"], "options": { "parser": "blade" } } ] }
My .blade.format.json config
{ "useLaravelPint": true, "spacesAfterDirective": 1, "spacesAfterControlDirective": 1, "phpOptions": { "singleQuote": true, "phpVersion": "8.2" }, "attributeJsOptions": { "semi": true, "printWidth": 120 } }
My pint.json config
{ "preset": "laravel", "rules": { "method_argument_space": true, "concat_space": { "spacing": "one" }, "single_trait_insert_per_statement": true, "types_spaces": { "space": "single" } } }
I have a test.blade.php file that looks like this:
@isset ($error) <p class="text-sm font-medium text-red-500">{{ $error }}</p> @endisset
I want to keep the space after my blade directives.
Now when I run prettier on only the file: npx prettier resources/views/compontents/input/test.blade.php the space is there.
npx prettier resources/views/compontents/input/test.blade.php
When I run prettier on the folder: npx prettier resources/views/components/input --write the space is removed.
npx prettier resources/views/components/input --write
When I set "useLaravelPint": false, the space is there when running prettier on either the file or the folder.
"useLaravelPint": false,
So the problem seems to be Laravel Pint removing the space, but only when running prettier on multiple files at once.
Very interesting! I'll dig in later this week and see what I can find out 🤔
Hi,
I'm running into a problem with formatting blade directives (space after), when using config
"useLaravelPint": true,
. If I run prettier on a single file it works, but if I run it for an entire folder it doesn't.My .prettierrc config
My .blade.format.json config
My pint.json config
I have a test.blade.php file that looks like this:
I want to keep the space after my blade directives.
Now when I run prettier on only the file:
npx prettier resources/views/compontents/input/test.blade.php
the space is there.When I run prettier on the folder:
npx prettier resources/views/components/input --write
the space is removed.When I set
"useLaravelPint": false,
the space is there when running prettier on either the file or the folder.So the problem seems to be Laravel Pint removing the space, but only when running prettier on multiple files at once.