Open mean-cj opened 3 years ago
@mean-cj Please share your steps to configure prettier plugin to work in as simple terms as possible, following the readme, didn't work for me
Short open tags (<?
) are not supported by the parser we're using, that's why the code is treated as an inline element (as if it was HTML). I can see that supporting (and automatically converting) short opening tags would be useful especially when working with legacy codebases, but I'm not sure if it's worth the effort considering that they are discouraged / being removed in recent PHP releases (https://wiki.php.net/rfc/deprecate_php_short_tags)
Hi
prettier/plugin-php is not format code in php (<?) short open tag , work with only (<?php)
Prettier 6.3.1 PHP Plugin 0.16.2
Input:
Save Output:
Input:
Save Output , Work with <?php :
Debug options { "filepath": "includes\get-approve-email.php", "parser": "php", "semi": false, "arrowParens": "always", "singleQuote": true, "printWidth": 800, "tabWidth": 3, "separatorWidth": 800, "trailingCommaPHP": false, "braceStyle": "psr-2", "requirePragma": false, "insertPragma": false } Thanks.