Open mburridge opened 2 years ago
The issue is more nuanced and tracked in https://github.com/WordPress/gutenberg/issues/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 https://github.com/prettier/prettier/issues/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.