Open luveqz opened 7 months ago
The plugin currently overrides this setting for a variety of reasons, and is a non-trivial thing to take into account at this time (https://github.com/Stillat/blade-parser-typescript/pull/91#issuecomment-1937077408).
The array directive item is a separate issue, not related to whitespace sensitivity that I'd look at separately (the Laravel Pint integration works correctly for this scenario, however).
@luveqz
I've released v2.1.2 to help prevent the issue that wrecked your array input. If you're curious, it was caused by an internal workaround that prevents items like the following from being shoved to a single-line by prettier:
@props([
'value',
'value',
'value',
'value',
'value',
])
This internal workaround was a bit too aggressive with what it was doing so I added a few checks to stop it from going into this logic.
Re. the htmlWhitespaceSensitivity
setting, unfortunately this isn't available just yet. This does come up quite a bit though so
I will start digging into it sometime this weekend (but may be a bit before its ready). Hope the array fix helps in the meantime!
I will start digging into it sometime this weekend
@JohnathonKoster ❤️ and if you would like some additional eyes or help, I would be happy to chip in. We have a number of templates that are mostly HTML w/ just a little Blade sprinkled here and there, so support for htmlWhitespaceSensitivity
will be big improvement. I'm happy to help with testing your changes, once you have some! 😄
Just an update that this is currently slated for the next major release of the plugin. Hopefully within the next few weeks 👍
Problem
Even when I set the htmlWhitespaceSensitivity rule to
strict
, the plugin keeps turning this:into this:
Or even this:
into this:
Demo
Open this minimal StackBlitz demo and run: