Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
90 stars 3 forks source link

Use short syntax for named slots #65

Closed pascalbaljet closed 1 year ago

pascalbaljet commented 1 year ago

Can the prettier plugin be configured to use the short slot syntax (with the colon)?

<x-slot:title>
    {{ __('My Title') }}
</x-slot>

{{-- gets formatted into: --}}

<x-slot name="title">
    {{ __('My Title') }}
</x-slot>
JohnathonKoster commented 1 year ago

This behavior has been improved in 1.6.5. Instead of having a new configuration option, the internal parsers will detect which style the slot was originally and restore that after formatting (internally it normalizes it to a normal tag pair so prettier doesn't freak out).

pascalbaljet commented 1 year ago

Thanks! Works perfectly!