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

chore: change prettier version to exact #3386

Merged
merged 2 commits into from
May 12, 2021

Conversation

Shinigami92
Copy link
Member

Description

Change Prettier to exact https://prettier.io/docs/en/install.html

Additional context

As described in the docs

Install an exact version of Prettier locally in your project. This makes sure that everyone in the project gets the exact same version of Prettier. Even a patch release of Prettier can result in slightly different formatting, so you wouldn’t want different team members using different versions and formatting each other’s changes back and forth.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Shinigami92 Shinigami92 requested a review from patak-dev May 12, 2021 16:24
@Shinigami92 Shinigami92 self-assigned this May 12, 2021
@Shinigami92 Shinigami92 added p1-chore Doesn't change code behavior (priority) dependencies Pull requests that update a dependency file labels May 12, 2021
@Shinigami92
Copy link
Member Author

The second commit just was yarn prettier --write . from the root

@patak-dev patak-dev merged commit d36e10e into main May 12, 2021
@patak-dev patak-dev deleted the change-prettier-to-exact-and-apply-formatting branch May 12, 2021 17:13
@meteorlxy
Copy link
Contributor

I don't think that setting an exact version of prettier in package.json is necessary, because we already have lockfile for that purpose 🤔

@Shinigami92
Copy link
Member Author

I don't think that setting an exact version of prettier in package.json is necessary, because we already have lockfile for that purpose

This doesn't prevent from local yarn installation

@meteorlxy
Copy link
Contributor

This doesn't prevent from local yarn installation

Didn't get your point 🤔 I think simply running yarn install locally won't change the lockfile if we didn't modify the package.json.

@Shinigami92
Copy link
Member Author

What would be the benefit of not using exact?
Over maybe inconsistent formatting instead of exact?

@meteorlxy
Copy link
Contributor

meteorlxy commented May 13, 2021

@Shinigami92 I just mean that it's not necessary to pin the version.

  • Prettier suggests to use exact version to avoid inconsistence, because some projects may not use lockfile.
  • Lockfile is the feature that helps you to use the exact version and avoid inconsistence, and we already included in the repo.

So in fact pin the version in package.json has no benifits (and no drawbacks, too). It's just useless.

That's why I said it's not necessary. But it's OK to do that.

I just want to remind you that you don't need to do that if you already have a lockfile. 😃

fi3ework pushed a commit to fi3ework/vite that referenced this pull request May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants