Comments (16)
Prettier 3 support landed in v0.20.0 π₯³
from plugin-php.
@erropix Ill take a look at #2197 and make a new release next week, currently on vacation ποΈ
from plugin-php.
Kindly fix this ASAP π
from plugin-php.
Working with prettier 3 would be amazing
from plugin-php.
with node v20.5.0
i forced install of prettier 3 and this plugin with :
npm install -D prettier@latest
npm install -D --force @prettier/plugin-php
i have type: module in package.json
when running prettier it said
[error] No parser could be inferred for file "src/Controller/ControlController.php"
so i added the following in .prettierrc.js
{
...
plugins: ["@prettier/plugin-php"],
}
and now it says :
[error] src/Controller/ControlController.php: TypeError: Invalid value used as weak map key
[error] at WeakMap.set ()
[error] at getSortedChildNodes (file://node_modules/prettier/index.mjs:17581:19)
[error] at file://node_modules/prettier/index.mjs:17576:52
[error] at Array.flatMap ()
[error] at getSortedChildNodes (file://node_modules/prettier/index.mjs:17575:6)
[error] at decorateComment (file://node_modules/prettier/index.mjs:17588:22)
[error] at decorateComment (file://node_modules/prettier/index.mjs:17599:14)
[error] at file://node_modules/prettier/index.mjs:17655:8
[error] at Array.map ()
[error] at attachComments (file://node_modules/prettier/index.mjs:17654:38)
from plugin-php.
Basic prettier 3 support landed in #2200 (thanks again @fisker!). Only thing that is blocking a release now are some failing tests in standalone mode (RUN_STANDALONE_TESTS=true yarn test
). I can try to investigate further tomorrow, but I'll also ping @loilo π
from plugin-php.
Thanks you @czosel π
from plugin-php.
@czosel, Do you have any information on when this plugin will be supporting prettier@3?
from plugin-php.
@czosel thanks for the reply, that's good news π
from plugin-php.
Prettier's plugin migration guidance: How to migrate my plugin to support Prettier v3?
More from the Prettier v3 changelog:
In order to support async parsers for embedded languages, we had to introduce a breaking change to the plugin API. Namely, the embed method of a printer has now to match a completely new signature, incompatible with previous versions. If you're a plugin author and your plugins don't define embed, you have nothing to worry about, otherwise see the docs for details.
from plugin-php.
Thanks for posting the reference @joemaller! AFAIK weβre currently not implementing embed. There might be a few tweaks we should do though - PRs are more than welcome!
from plugin-php.
I gave the upgrade a try in #2200, but got stuck in the process. Turns out that several changes are needed to make this plugin compatible with prettier v3. Since I'm short on time, I'd be happy for any help with completing the upgrade.
from plugin-php.
Do we have plan to migrate to ESM?
from plugin-php.
Definitely! Thanks for all your contributions @fisker, Iβll review and merge them tonight (CET)!
from plugin-php.
Updated playground to Prettier 3 and Plugin version v0.20. π
from plugin-php.
Nice, thanks @loilo! π―
from plugin-php.
Related Issues (20)
- Backward compatibility for CommonJS
- `npx prettier . --check` doesn't check php files HOT 3
- Class and method braces with no body split onto multiple lines HOT 2
- Brackets vanish in Recursive IIFE
- Attributes removed since 0.19.2 if method argument has an attribute with attributes in them and arrays and some new lines
- Comments in attributes (e.g. for an array item) are weirdly moved to somewhere completely else HOT 2
- Some comment positions inside attributes can result in prettier failing with an exception
- Docs: specify if prettier follow psr-12 or something else
- Syntax error when attributes are defined to enum cases
- Class Constants Types PHP 8.3 support HOT 5
- [bug] singleQuote option from API call does not work on latest release
- INC file extension not recognized
- Issue HOT 1
- Adjobscc.io
- Allow attributes to be placed above constructor properties HOT 1
- Invoked import/require callable removes necessary parentheses
- Nguyenthaocc727
- parentheses bug. HOT 2
- does not respect prettier printWidth in overrides since v0.22.0 HOT 2
- Removes brackets from require_once which changes the evaluation of the expression (Laravel 11 index.php)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-php.