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 project scaffolded by @wordpress/create-block is consistent with the WordPress Coding Standards, but it doesn't enforce them in subsequent development.
If you deviate from the WordPress Coding Standards the linter will adapt, e.g. if you put double quotes around a string in a .js file in a newly scaffolded project and then save the file the linter will put double quotes around all the strings.
What is your proposed solution?
I think simply adding:
"prettier": "@wordpress/prettier-config"
to the package.json file generated in the project will enforce the WordPress Coding Standards when a file in the project is saved.
The text was updated successfully, but these errors were encountered:
The issue is more nuanced and tracked in #21872. One of the motivations of the proposal to change WordPress Coding Standards for JavaScript was the ability to use the original Prettier that would resolve this issue. Unfortunately, this attempt failed because of the lack of consensus from WordPress core committers. The alternative approach to convenience Prettier's maintainers to add exception for the WordPress project prettier/prettier#13107 has also stalled.
What problem does this address?
The project scaffolded by
@wordpress/create-block
is consistent with the WordPress Coding Standards, but it doesn't enforce them in subsequent development.If you deviate from the WordPress Coding Standards the linter will adapt, e.g. if you put double quotes around a string in a
.js
file in a newly scaffolded project and then save the file the linter will put double quotes around all the strings.What is your proposed solution?
I think simply adding:
"prettier": "@wordpress/prettier-config"
to the
package.json
file generated in the project will enforce the WordPress Coding Standards when a file in the project is saved.The text was updated successfully, but these errors were encountered: