plugin-php
plugin-php copied to clipboard
prettier-ignore breaking class private/public/protected accessors
Hello,
Same issue like #1798, but instead of consts, it breaks protected/public/private definition.
Thanks,
@prettier/plugin-php v0.18.3 Playground link
Input:
<?php
class ClassA {
protected $test = 1;
// prettier-ignore
protected $test = 2;
}
Output:
<?php
class ClassA
{
protected $test = 1;
// prettier-ignore
$test = 2
}
Any update? Same issue here.
And also static
is removed.
class A
{
// prettier-ignore
static $test = 1;
}
becomes
class A
{
// prettier-ignore
$test = 1
}
This is caused by a bug in the parser: https://github.com/glayzzle/php-parser/issues/511
Thank you @czosel
Workaround: https://github.com/prettier/plugin-php/issues/1222#issuecomment-924452644