Skip to content

Current use of semver not applicable to prettier #2201

@reinseth

Description

@reinseth

First off, thanks for a great library and fantastic effort for the community.

This is a suggestion about the versioning scheme used by prettier.

I would argue that using the minor version of semver for changes isn't applicable to prettier. Why? Any changes that leads to different formatting isn't really compatible with the previous version. For instance, if package.json specifies ^1.2.2 (where a caret version is the default when installing with npm), one repo user could still be at 1.2.2 and another repo user could be at 1.4.4, and they would have different formatting applied the sources leading to an inconsistent style across the project (and following commit wars until the version difference is resolved).

A workaround would be to use a tilde (~) version in package.json to only allow automatic patch upgrades, but since this is not the default behaviour of npm it will probably lead to problems for many people who are not aware of the issue.

My suggestion is to always increment the major version whenever a change that leads to different formatting is applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions