feat: add lint-semver-ranges
command
#56
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @JamieMason! First of all, thanks for creating this project - it's a great tool to have when dealing with monorepos.
Description (What)
I have added a
lint-semver-ranges
command, which works just like the existingfix-semver-ranges
command, except that it simply outputs all the non-compliant dependency versions instead of fixing them.Justification (Why)
My use case for this command is a project in which a) I cannot force everyone to use
fix-semver-ranges
before pushing the code (e.g., via a pre-commit hook), and b) the CI process can't commit changes to dependency versionsOf course, I could work around the limitations by failing the CI job if running
fix-semver-ranges
modifies any file, but adding a "lint" capability to the project looks like the cleanest solution.How Can This Be Tested?
Command name:
lint-semver-ranges
:https://github.com/ArturWierzbicki/syncpack/blob/82916f7248c025039d18d94181645b8758fc2381/package.json#L13
Example output:
I did two small refactors in order to reuse as much code from
fix-semver-ranges
as possible. Looking forward to your feedback!