-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ESLint Plugin: Add the recommended Prettier config to enforce WP coding styles #21602
Conversation
Size Change: 0 B Total Size: 839 kB ℹ️ View Unchanged
|
2e08ee4
to
8c033e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be considered a breaking change? i.e. Any change for developers who had come to rely on the previous default behavior?
Well, this will make code that was previously marked as correct now be marked as incorrect. But in some sense, it's a move back to the behaviour of 3.4.1 from the changes introduced in 4.0.0... (not 100%) |
I guess it can be fair if it falls under the realm of "Behavior which was never intended in the first place", to consider it as a bug fix. |
Yes, #20509 is marked as a bug, so this would be a bugfix, therefore not breaking |
I had it as a breaking change first, but it was never intended to allow the default Prettier coding style so bugfix seems reasonable. I'm doing a hotfix release soon, let's include this one as well, so most of the projects will get it together with breaking changes :) |
…ng styles (#21602) * ESLint Config: Add the recommended Prettier config to enforce WordPress coding styles * Update CHANGELOG.md
Description
Fixes #20509. An alternative to #21503.
This PR always uses the recommended Prettier config to enforce WordPress coding styles but it respects the Prettier config overrides defined by projects.
It turns out that there is
usePrettierrc
option inprettier/prettier
rule (https://github.com/prettier/eslint-plugin-prettier#options):This way we could remove the config in
@wordpress/scripts
for Prettier and use@wordpress/prettier-config
in all places instead.How has this been tested?
It's also possible to test the changes applied to the
@wordpress/eslint-config
by removing.prettierrc.js
file in the root of the project and executing:npm run lint-js
Checklist: