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

fix(version): only apply prettier if it was explicitly installed #3406

Merged
merged 1 commit into from Nov 2, 2022

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Nov 2, 2022

Description

Only invoke prettier on changed files if the user has explicitly listed it in their root package.json.

Motivation and Context

It is theoretically possible that a user could end up with a copy of prettier in their node_modules despite not being a direct user of it. This situation might cause unwanted formatting changes to their files when running lerna version.

Nobody has explicitly reported this case to us, but it is theoretically possible and we might have seen it be indirectly reported via a community blog post.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (change that has absolutely no effect on users)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@JamesHenry JamesHenry marked this pull request as ready for review November 2, 2022 19:51
@JamesHenry JamesHenry enabled auto-merge (squash) November 2, 2022 19:51
@JamesHenry JamesHenry merged commit 0161bbe into main Nov 2, 2022
@JamesHenry JamesHenry deleted the explicit-prettier branch November 2, 2022 21:27
rrhodes pushed a commit to rrhodes/lerna that referenced this pull request Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants