Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch prettier to an optional- or peerDependency #84

Closed
sirlancelot opened this issue Mar 25, 2020 · 2 comments
Closed

Switch prettier to an optional- or peerDependency #84

sirlancelot opened this issue Mar 25, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sirlancelot
Copy link

sirlancelot commented Mar 25, 2020

With the release of Prettier v2.x, projects wishing to update to the latest version will download both versions of Prettier due to this module having a hard dependency on v1.x.

Since Prettier is only require'd when prettify == true and NODE_ENV != "production", can this dependency be switched to an optionalDependency or peerDependency? Or perhaps its version requirement relaxed to include v2.x?

@LinusBorg LinusBorg added the enhancement New feature or request label Mar 25, 2020
@P4sca1
Copy link

P4sca1 commented Apr 6, 2020

Totally agree with making prettier a peerDependency. Currently this causes problems in my workspace, because yarn keeps placing a version < 2.0.0 in the .bin folder, even though I have listed prettier 2.0.4 in my dependencies.

@haoqunjiang
Copy link
Member

  • Making it a peer dependency ❌ This would a breaking change
  • Relaxing the version requirement to 2.x ❌ This would break Node.js 8.x users
  • Making it an optional dependency ✅ This would be mostly fine

Currently this causes problems in my workspace

To be fair, it is Yarn that causes the problem, not this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants