shufo / prettier-plugin-blade

Format your blade template using Prettier
https://www.npmjs.com/package/@shufo/prettier-plugin-blade
MIT License
318 stars 8 forks source link

[Formatting Bug]: Adds spaces where there shouldn't be #239

Closed calebdw closed 9 months ago

calebdw commented 9 months ago

Version

1.11.1

Template before formatting

@php
    use Eagle\Utilities\Dates\TimeZone;
<- no spaces here
    $timezone_options =
        ['' => ''] +
        TimeZone::create()
            ->format('tz-label')
            ->countryCodePriority('US')
            ->get();
@endphp

Template after formatting

@php
    use Eagle\Utilities\Dates\TimeZone;
    <- four spaces here
    $timezone_options =
        ['' => ''] +
        TimeZone::create()
            ->format('tz-label')
            ->countryCodePriority('US')
            ->get();
@endphp

Expected Behaviour

The formatter shouldn't input spaces where there should just be a newline char---some editors show these whitespace characters and remove them automatically:

image

Note that this only applies to extra spaces at the end of the line

Relevant log output

No response

shufo commented 9 months ago

Fixed at https://github.com/shufo/prettier-plugin-blade/releases/tag/v1.13.1. Thank you @CalebDW!