-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add prettier code formatter #7274
Conversation
Plugin builds for 0d46ad0 are ready 🛎️!
|
As opposed to applying prettier, I thought we were just going to disable prettier from running to avoid making many changes? I mean, I don't think it's necessarily a problem to update the formatting since I don't think there are significant PRs that would be made stale by applying prettier. I don't feel strongly either way. Just curious. |
Ahh. Maybe I misinterpreted our discussion. I think I can add prettier 😄
I also considered the case and I think having a code formatter like prettier is not a bad choice. Prettier is a very widely used tool and can be helpful in developer experience which is useful in the long run if someone wanted to work with JS codebase. We can disable it as well. I am aware of disabling it in VSCode using a config file but not sure about other code editors/IDEs. |
Note: we'll need to Squash-merge this and then add the commit hash to a Update: See 82fd59f. |
Summary
This PR aims to add prettier as the code formatter.
prettier
and@wordpress/prettier-config
devDeps.@wordpress/eslint-plugin
config from@wordpress/eslint-plugin/recommended-with-formatting
to@wordpress/eslint-plugin/recommended
as it incorporates prettier by default.eslint-disable
andtranslators
comments(It is done because prettier and ESLint use different JS parsers, hence prettier was showing errors at how thoseeslint-disable
comments were placed.).react/jsx-one-expression-per-line
) due to conflict with prettier..eslintrc
to.eslintrc.js
as it is recommended to use an extension-based config file.Checklist