site-kit-wp
site-kit-wp copied to clipboard
Upgrade prettier to latest
Feature Description
wp-prettier
has a new release that we should upgrade to, as there hasn't been a stable release in a few years. This is complicated by changes which require configuration and/or formatting updates (see #5539).
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
-
wp-prettier
should be upgraded to the latest version - Required formatting changes should be minimized
- Any large-scale formatting that is still required should be coordinated with the team to minimize disruption before merging
Implementation Brief
Although there are a lot of errors introduced when bumping to the latest wp-prettier
version, it appears that they are all the result of non-configurable formatting changes introduced in Pretter 2.3.0
- see https://prettier.io/blog/2021/05/09/2.3.0.html
This being the case, we have no choice but to fix the errors, meaning we'll need to coordinate this amongst the team to avoid running into unnecessary conflicts.
- Coordinate on Slack to find the best time to apply the changes.
- Upgrade
wp-prettier
to version2.6.2
. As per the standard Prettier install guidelines, keep the exact version pinned.
npm install --save-dev --save-exact "prettier@npm:[email protected]"
- Fix the lint errors that can be auto-fixed with
npm run lint:js-fix
. - Manually fix any remaining lint errors.
Test Coverage
- All tests & CI pipelines should continue to pass.
QA Brief
- Run
npm i
to update the package locally - Build the project and ensure that the style changes don't break anything when compiling
- Check the console for any JS warnings/errors
- For extra testing, run the lint command, and ensure that it passes
Changelog entry
- Update Prettier dependency and update automated source code formatting.
IB ✔️
Note: no QA needed for this commit as it doesn't affect any functionality, only code formatting. Moving directly to approval.
(If any issues are found related to this change we can adjust accordingly, but in my testing and in CI it seems fine 🙂)