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

The lines keep being indented to the right on every run #107

Open
apih opened this issue Jul 9, 2024 · 3 comments
Open

The lines keep being indented to the right on every run #107

apih opened this issue Jul 9, 2024 · 3 comments

Comments

@apih
Copy link

apih commented Jul 9, 2024

As per the sample, the lines in the @if statement will be indented to the right on every run. The weird thing is that it only happens to the first @if, but not the subsequent ones.

@section('head-mid')
    <!-- Facebook's Open Graph -->
    @if ($form->picture !== '')
-        <meta property="og:image" content="{{ $form->picture_url }}" />
-    @endif
+            <meta property="og:image" content="{{ $form->picture_url }}" />
+        @endif

    <!-- Twitter's Card -->
    @if ($form->picture !== '')
        <meta property="twitter:image" content="{{ $form->picture_url }}" />
    @endif
@endsection
@JohnathonKoster
Copy link
Contributor

JohnathonKoster commented Jul 10, 2024 via email

@JohnathonKoster
Copy link
Contributor

Apologize for the late follow up - I am unable to reproduce this. Is that the entire template, and could I also get your formatting config?

Thanks!

@apih
Copy link
Author

apih commented Aug 8, 2024

It was not the entire template, but I isolated that part into its own file, and the same behavior occurred.

My .blade.format.json:

{
    "useLaravelPint": true,
    "classStrings": {
        "enabled": false
    },
    "formatJsAttributes": false
}

My .prettierrc.json:

{
    "printWidth": 160,
    "tabWidth": 4,
    "trailingComma": "es5",
    "singleQuote": true,
    "plugins": [
        "prettier-plugin-blade"
    ],
    "overrides": [
        {
            "files": [
                "*.blade.php"
            ],
            "options": {
                "parser": "blade",
                "printWidth": 300
            }
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants