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
Upgrade to wp-prettier 2.2.1 #47950
Upgrade to wp-prettier 2.2.1 #47950
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes make sense to me.
ce046ec
to
ab5e8c9
Compare
Thanks @scinos for approving 👍 Now I also published the package to NPM and added another commit that upgrades |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual inspection of changes looks good, thanks 👍
LGTM. Code Style errors seems to be unrelated. |
One of them are missing JSDoc params that are trivial and zero-risk to fix. So I pushed a commit with that. The second file with violations is more interesting. It's in an error boundary React component written by @nbloomf where a TypeScript ESLint rule complains about return types of methods not being declared on the component's methods:
In general, this rule makes sense: it encourages that types that are part of public APIs are explicitly named and declared, instead of just being anonymous types inferred from code. But here, the offending methods are methods of the
It's already pretty clear what the types are supposed to be, and they have names and definitions. There's no need to repeat what a return type of |
This is how Calypso codebase gets reformatted after upgrade to
wp-prettier@2.2.1
. I was originally testing with a local build, so the PR contained only the formatting changes and not the package upgrade. Later after verifying the upgrade both with Calypso and Gutenberg, I publishedwp-prettier@2.2.1-beta-§
to NPM and updated ourpackage.json
accordingly.Notable changes:
no longer breaks the argument list of the inline arrow function and formats the code more nicely:
This is an expected change that's been announced in Prettier 2.2.0 changelog.
Then there's fixed arrow function formatting inside Styled Components template literal:
Also expected, it's a bug fixed in 2.1.2 (prettier/prettier#9136) after our report.
Finally, Prettier stopped breaking type parameters in long
class ... extends
statements.Before:
After: