Repository navigation
Upgrade wp-prettier to v3.0.3 - #54539
Conversation
Mamaduka
left a comment
There was a problem hiding this comment.
The e2e test changes look good to me 👍
There was a problem hiding this comment.
This is wrong, formatting union types in tuples needs fixing.
|
Size Change: +43 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
gziolo
left a comment
There was a problem hiding this comment.
The changes applied to the ESLint plugin, WP scripts and the Gutenberg plugin look good.
It would be great to get also feedback regarding the formatting changes applied to the codebase. As a follow-up, we could list the final commit as ignored in git blame, see https://github.com/WordPress/gutenberg/blob/trunk/.git-blame-ignore-revs. Although, it's also fine to skip it this time as the changes aren't impactful.
There was a problem hiding this comment.
I don't think we need it anymore here after upgrading the lock file. Although if there is a reason to keep it, it's fine.
There was a problem hiding this comment.
I had to add this to the root package.json because otherwise the plugin got installed only into the /packages/eslint-plugin/node_modules subdirectory, not to the root node_modules. For some reason, even the new npm client didn't hoist the package, although it could, the slot is available, there is no second version of the same package that would conflict. And the wp-scripts lint-js command fails when the ESLint plugins are not resolvable from the root directory.
There was a problem hiding this comment.
Based on my experience, it's an issue with npm in general. After the lock file gets correctly updated, if you remove the dependency from package.json, it should remain hoisted. However, I don't guarantee it. It works in most of the cases 😄
There was a problem hiding this comment.
The sequence of events is like:
- install a new package. For some reason NPM installs it into a subdirectory instead of hoisting.
- install it again, this time also pinning it in the root
package.json. NPM is forced to hoist it. - remove it from the root
package.json. In the lockfile, the package is already in the hoisted position, and NPM won't move it -- there is no reason to move it, the hoisted position is fine. - when further changing the lockfile, the package remains in the hoisted position, because NPM respects the lockfile and the actual physical files in
node_modules, and doesn't move them unless it really has to.
Thanks for the reminder 👍 Yes, it needs to be a separate PR, after we know for sure what is the SHA of the |
|
Flaky tests detected in 4d9202d4de0e58727da09c912b7608fbb7562b6c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6220571870
|
There was a problem hiding this comment.
Seems like it's adding unwanted extra spaces in tuples, regarding of whether they're on multiple lines or not.
There was a problem hiding this comment.
The comma after a single generic parameter definitely looks odd 🤔
There was a problem hiding this comment.
And yet it's perfectly logical, that's how trailingComma should work. The idea is when you add a second type parameter, it's a one-line diff, not two-line.
There was a problem hiding this comment.
That rationale makes sense to me 👍
There was a problem hiding this comment.
@tyxla Did you just manually format the .md file to create this change? Maybe we should automatically format all .md files.
There was a problem hiding this comment.
No, I formatted it automatically running npm run other:check-local-changes locally. No other changes were created.
There was a problem hiding this comment.
Re-added the commit since it seemed to be lost during the last rebase.
There was a problem hiding this comment.
Oh sorry, I did a rebase to include latest changes in trunk and this is what git push -f does 🙂
I added one more commit that formats some .md files, the ones that contained the call(/* foo */) formatting bug (missing spaces around the comment).
And also changelog entries for the eslint-plugin and scripts packages. The CI job demands also an entry for components, but that's not a reasonable request here, there are just formatting changes.
tyxla
left a comment
There was a problem hiding this comment.
Couldn't spot any other regressions other than the extra trailing space after unions in tuples. The rest contains a bunch of improvements 👍
51d9d7b to
9fb33d6
Compare
Upgrades the
wp-prettierfork to version 3.0.3.Most visible formatting changes are:
( await x )expression had an extra trailing spacecall( /* none */ )) didn't have paren spacesconst x = y;) are now formatted more nicely, often breaking after the=How to test:
Go through the list of the formatting changes and report anything suspicious.