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
{{ message }}
Repository navigation
Scripts: format has unknown option parenSpacing #34622
Ok, after some research, I found that npm install "prettier@npm:wp-prettier@latest" --save-dev
is necessary in the project folder.
For some reason the declared dependency to this in the package.jsons of @wordpress/scripts and @wordpress/eslint-plugin is not sufficient?
It looks like it's exactly the same issue as reported in #21872. It's just the context is different. { parenSpacing: true } is a custom config from the Prettier's fork we use to follow WordPress coding standards.
The best way to move forward is to stop using the fork and use what the official Prettier has to offer. This is where it is heading, we just need to go through the formal standard of changing coding conventions.
Let's close this issue as a duplicate of #21872. Thank you for reporting back your findings and documentation of all the issues you had. It's a good reminder why using an npm alias doesn't scale well 👍🏻
Thanks for finding the duplicate, @gziolo! Indeed, this seems to be the same underlying issue. Too bad that a custom fork of Prettier is needed. However, changing the WP JS coding standards doesn't sound too intriguiing either, as it would quite differ much from the WP PHP coding standards. But that's not for this thread :-)
Activity
TobiasBg commentedon Sep 7, 2021
Ok, after some research, I found that
npm install "prettier@npm:wp-prettier@latest" --save-devis necessary in the project folder.
For some reason the declared dependency to this in the package.jsons of
@wordpress/scriptsand@wordpress/eslint-pluginis not sufficient?gziolo commentedon Sep 10, 2021
It looks like it's exactly the same issue as reported in #21872. It's just the context is different.
{ parenSpacing: true }is a custom config from the Prettier's fork we use to follow WordPress coding standards.The best way to move forward is to stop using the fork and use what the official Prettier has to offer. This is where it is heading, we just need to go through the formal standard of changing coding conventions.
Let's close this issue as a duplicate of #21872. Thank you for reporting back your findings and documentation of all the issues you had. It's a good reminder why using an npm alias doesn't scale well 👍🏻
TobiasBg commentedon Sep 10, 2021
Thanks for finding the duplicate, @gziolo! Indeed, this seems to be the same underlying issue. Too bad that a custom fork of Prettier is needed. However, changing the WP JS coding standards doesn't sound too intriguiing either, as it would quite differ much from the WP PHP coding standards. But that's not for this thread :-)
gziolo commentedon Sep 10, 2021
Couldn't agree more 😅