You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The update to @wordpress/scripts 26.13.0 seems to have caused an issue where spaces are being removed around parens via npx wp-scripts format and flagged by npm wp-scripts lint-js. I've noticed this on a couple different projects using the @wordpress/scripts library for formatting and building blocks.
I believe #54539 is the cause, and I don't believe it was intentional. I've posted npm ls prettier output below that may point to that, but I'm not at all sure why. I'm happy to help test any changes though. 😄
jordesign
changed the title
wp-scripts lint-js and format should preserve spaces within parens
wp-scripts lint-js and format should preserve spaces within parents
Sep 24, 2023
Description
The update to
@wordpress/scripts
26.13.0 seems to have caused an issue where spaces are being removed around parens vianpx wp-scripts format
and flagged bynpm wp-scripts lint-js
. I've noticed this on a couple different projects using the@wordpress/scripts
library for formatting and building blocks.I believe #54539 is the cause, and I don't believe it was intentional. I've posted
npm ls prettier
output below that may point to that, but I'm not at all sure why. I'm happy to help test any changes though. 😄Step-by-step reproduction instructions
In a clean directory:
npm install @wordpress/[email protected]
echo "const x = ( a ) => { return a -1 };" > index.js
npx wp-scripts lint-js index.js
npm install @wordpress/[email protected]
npx wp-scripts lint-js index.js
Replace ·a·)·=>·{·return·a·-1· with a)·=>·{⏎↹return·a·-·1;⏎
(noting space before/aftera
is removed)In each scenario,
npx wp-scripts format
follows the behavior oflint-js
.Screenshots, screen recording, code snippet
No response
Environment info
I've tried this with both Node 16 and Node 18.
With Node 16, when I run
npm ls prettier
, which I picked up while reading #21872, I see this:26.12.0:
26.13.0:
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: