shufo / vscode-blade-formatter

An opinionated Blade file formatter for VSCode

Home Page:https://marketplace.visualstudio.com/items?itemName=shufo.vscode-blade-formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Format <script type="module"></script>

mmuqiitf opened this issue · comments

Description

When i use a tag for <script type="module"></script> in my blade component, it doesn't work for formatting like common <script></script>. For example :

@push('scripts')
    <script type="module">
        $("#table-kategori").DataTable({
            processing: true,
            serverSide: true,ajax: "{{ route('kategori.list') }}",
            columns: [{data: "DT_RowIndex",
                    name: "DT_RowIndex",orderable: false,searchable: false
                },
                {
                    data: "nama",name: "nama"
                },
                {
                    data: "jumlah_barang",
                    name: "jumlah_barang"
                },
                {
                    data: "created_at",
                    name: "created_at"
                },
                {
                    data: "action",
                    name: "action"
                },
            ],
        });
    </script>
@endpush

When i hit save, javascript are not formatted properly. But when i remove type="module" it works properly formatted.

Suggested Solution

@push('scripts')
    <script type="module">
        $("#table-kategori").DataTable({
            processing: true,
            serverSide: true,
            ajax: "{{ route('kategori.list') }}",
            columns: [{
                    data: "DT_RowIndex",
                    name: "DT_RowIndex",
                    orderable: false,
                    searchable: false
                },
                {
                    data: "nama",
                    name: "nama"
                },
                {
                    data: "jumlah_barang",
                    name: "jumlah_barang"
                },
                {
                    data: "created_at",
                    name: "created_at"
                },
                {
                    data: "action",
                    name: "action"
                },
            ],
        });
    </script>
@endpush

Alternatives

No response

Additional Context

No response

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

I hope this feature is getting done, because i really need this