Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Formatting Bug]: Arrays are being collapse on a single line #235

Closed
calebdw opened this issue Sep 15, 2023 · 3 comments · Fixed by shufo/blade-formatter#876
Closed

[Formatting Bug]: Arrays are being collapse on a single line #235

calebdw opened this issue Sep 15, 2023 · 3 comments · Fixed by shufo/blade-formatter#876
Assignees
Labels
bug Something isn't working

Comments

@calebdw
Copy link

calebdw commented Sep 15, 2023

Version

1.11.1

Template before formatting

@props([
    'name',
    'title'                => 'Please Confirm',
    'message'              => 'Are you sure?',
    'level'                => 'info',
    'icon'                 => 'heroicon-o-question-mark-circle',
    'cancelButtonText'     => 'No',
    'cancelButtonType'     => 'muted',
    'affirmButtonText'     => 'Yes',
    'affirmButtonType'     => 'success',
    'affirmButtonDisabled' => false,
])

Template after formatting

@props(['name', 'title' => 'Please Confirm', 'message' => 'Are you sure?', 'level' => 'info', 'icon' => 'heroicon-o-question-mark-circle', 'cancelButtonText' => 'No', 'cancelButtonType' => 'muted', 'affirmButtonText' => 'Yes', 'affirmButtonType' => 'success', 'affirmButtonDisabled' => false])

Expected Behaviour

It should stay the same, I don't want the array collapsed and it most definitely exceeds the line limit of 120 chars.

Relevant log output

No response

@calebdw calebdw added the bug Something isn't working label Sep 15, 2023
@Andreas-Halemba
Copy link

@shufo can you confirm this as expected behaviour?

@shufo
Copy link
Owner

shufo commented Oct 15, 2023

Fixed at https://github.com/shufo/prettier-plugin-blade/releases/tag/v1.13.2

@chrillep
Copy link

chrillep commented Jan 11, 2024

@shufo same goes for any arrays, is this intended? :)

@php
$array = [
    'col-span-1',
    'flex',
    'flex-col',
    'gap-6',
    'border',
    'border-secondary1',
    'py-6',
    'rounded-4xl'
];
@endphp

becomes

@php
$array = ['col-span-1', 'flex', 'flex-col', 'gap-6', 'border', 'border-secondary1', 'py-6', 'rounded-4xl'];
@endphp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants