Skip to content

Prettier unexpectedly moves docblock #1546

@leighman

Description

@leighman

@prettier/plugin-php v0.14.3
Playground link

Input:

<?php

$my_date_time = new /** @psalm-immutable */ class extends DateTimeImmutable {};

Output:

<?php

$my_date_time = new class/** @psalm-immutable */  extends DateTimeImmutable {};

I would expect the docblock to annotate the class and not be moved.

The output is not valid with psalm https://psalm.dev/r/bf04faa3c1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions