Skip to content

chore: upgrade prettier from 2.x to 3.x #431

@hb2708

Description

@hb2708

Summary

Upgrade prettier from 2.1.2 to 3.x. This will cause formatting changes across the codebase due to updated defaults and improved formatting rules.

Current → Target

Package Current Latest
prettier 2.1.2 3.8.1
eslint-plugin-prettier 4.2.1 5.5.5
eslint-config-prettier 8.5.0 10.1.8

Why Upgrade

  • v2 is no longer maintained
  • v3 has better formatting for many edge cases
  • Improved TypeScript and JSX formatting

Migration Steps

  1. Install new versions together (eslint-prettier integration must be compatible):
    yarn add --dev prettier@latest eslint-plugin-prettier@latest eslint-config-prettier@latest
  2. Review config changes — some defaults changed in v3:
    • trailingComma default changed from "es5" to "all"
    • Review .prettierrc or prettier config if one exists
  3. Reformat the entire codebase in a single commit:
    npx prettier --write .
  4. Commit the formatting changes separately — this makes git blame cleaner. Consider adding a .git-blame-ignore-revs file with the reformat commit hash.
  5. Run yarn ci to verify lint + tests pass with the new formatting

⚠️ Note

This will produce a large diff touching many files. It's best done:

  • As a standalone PR with no other changes
  • When there are few open PRs to minimize merge conflicts

Files Affected

  • Nearly every .ts/.tsx/.js file (formatting changes)
  • package.json — dependency versions
  • Possibly .prettierrc or prettier config

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions