✏️ move prettier to peerDependencies
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
prettiera peer dependency, this ensures only one version of Prettier is used in a project. - Prettier is also added to
devDependenciesfor 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
Do we need to mark it optional? Not sure since I don't know if the module provides functionality can use without Prettier.
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.