Skip to content

Upgrade dependency @types/prettier from ^2.0.0 to ^3.0.0 | Hypermod.io#261

Open
github-actions[bot] wants to merge 1 commit intomainfrom
hypermod-transform/cmo259ptv0006l404xzei6ku2
Open

Upgrade dependency @types/prettier from ^2.0.0 to ^3.0.0 | Hypermod.io#261
github-actions[bot] wants to merge 1 commit intomainfrom
hypermod-transform/cmo259ptv0006l404xzei6ku2

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Automated update for @types/prettier to version 3.0.0.

The @types/prettier major version update to 3.0.0 involves critical changes due to Prettier's shift to ECMAScript Modules, changes to plugin interfaces, and other adjustments detailed below.

Description

This update will migrate @types/prettier from version 2.0.0 to 3.0.0, reflecting significant changes in the Prettier 3.0 release. Updates include new module styles, alterations to plugin and parser functionality, and configuration changes such as the default trailing comma behavior.

Workflow

Step 1

Ensure all Prettier plugins and dependencies are compatible with ECMAScript Modules.


Ensure your installation/npm script can handle ESM modules.

Step 2

Update Prettier configuration files to support ECMAScript Modules, if applicable.


Change your config files to: prettier.config.mjs or .prettierrc.mjs

Step 3

Update any Prettier CLI commands to reflect new script paths and configurations.


From:
node ./node_modules/prettier/bin-prettier.js . --write
To:
node ./node_modules/prettier/bin/prettier.cjs . --write

Step 4

Adapt to changes in trailing commas if your project relies on them (default is now 'all').


Update Prettier config:
{
  "trailingComma": "es5"
}  // if legacy behavior is preferred

Step 5

For projects using ".css" parser, update settings to avoid confusion with Less or Scss by specifying correct parsers or removing parser option for autodetection.


Adapt parser settings if you encounter syntax errors after upgrading.

Potential Issues

  • Compatibility issues with plugins that have not been updated to support Prettier 3.0 ECMAScript Modules.
  • Config files not being recognized if the naming doesn't comply with ESM requirements.

Other Dependencies

Dependencies potentially affected by the upgrade:

  • stylelint-prettier should also be upgraded to align with Prettier 3.
  • Any custom plugins or tools built on top of Prettier should be reviewed for compatibility.

References

Workflow:

  • Upgrade Dependency

    • dependency-name: @types/prettier
    • version: ^3.0.0
  • Move File

    • file-path: prettier.config.js
    • destination-path: prettier.config.mjs
  • Move File

    • file-path: .prettierrc.js
    • destination-path: .prettierrc.mjs
  • @types/prettier@3.0.0-cli-command-updates

  • Create File

    • file-path: prettier.config.json
    • file-content: {
      "trailingComma": "es5"
      }

PR created automatically by the Hypermod Dependency Bot configured by: Daniel Del Core.


Deployment created using Hypermod.io 💫

documentation | support

Hypermod Logo

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

⚠️ No Changeset found

Latest commit: 61cc1ce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants