Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project scaffolded by @wordpress/create-block does not enforce WordPress Coding Standards #44095

Open
mburridge opened this issue Sep 12, 2022 · 1 comment
Labels
[Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement.

Comments

@mburridge
Copy link
Contributor

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.

@mburridge mburridge added the [Tool] Create Block /packages/create-block label Sep 12, 2022
@gziolo
Copy link
Member

gziolo commented Sep 14, 2022

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.

@gziolo gziolo added [Tool] WP Scripts /packages/scripts and removed [Tool] Create Block /packages/create-block labels Sep 14, 2022
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants