prettier-plugin-blade icon indicating copy to clipboard operation
prettier-plugin-blade copied to clipboard

✏️ move prettier to peerDependencies

Open YvetteNikolov opened this issue 3 months ago • 2 comments

Move Prettier to peerDependencies

Hi there 👋

This PR moves Prettier from dependencies to peerDependencies and devDependencies.

Why?

  • Having Prettier as a dependency meant the plugin always installed its own version, which clashes with whatever version the user already has. For example, the digital agency I work with uses a fork of prettier to work with WordPress coding standards (npm:wp-prettier@^3.0.3)
  • By making prettier a peer dependency, this ensures only one version of Prettier is used in a project.
  • Prettier is also added to devDependencies for development and testing of the plugin.

Would you be able to consider this change? This change also makes sure the plugin follows best practices for Prettier plugins.

Solves https://github.com/shufo/prettier-plugin-blade/issues/312

YvetteNikolov avatar Sep 12 '25 10:09 YvetteNikolov

Do we need to mark it optional? Not sure since I don't know if the module provides functionality can use without Prettier.

fisker avatar Sep 12 '25 10:09 fisker

Checked the codebase, this package does not provide any features (cli, helpers(?)) that work without Prettier. The only way to use it is via Prettier, as a plugin. So Prettier is a required peer dependency. Marking it optional would risk silent breakage. If you think there’s a use case I missed — happy to adjust!

Since this change requires users to install Prettier themselves, it could break existing setups that relied on the bundled Prettier. It might be worth considering a minor of major version bump (e.g. v1.17.0 / v2.0.0) to signal this change.

YvetteNikolov avatar Sep 12 '25 13:09 YvetteNikolov