Skip to content

Conversation

@achingbrain
Copy link
Member

Our JS code guidelines say we should use ~ as a prefix for pre-v1 dependencies. Sadly npm disagrees and uses ^ by default.

This PR adds a linting step that examines all dependencies and strenuously objects if it sees anything that violates the guidelines.

https://github.com/ipfs/community/blob/master/js-code-guidelines.md#dependency-versions

@ghost ghost assigned achingbrain May 21, 2018
@ghost ghost added the status/in-progress In progress label May 21, 2018
@achingbrain achingbrain force-pushed the lint-package-json-dep-versions branch from be9a3a9 to 64667ad Compare May 21, 2018 18:31
Copy link
Member

@dryajov dryajov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks, this should help preventing our issues with the semantic version flags getting changed around randomly.

@achingbrain
Copy link
Member Author

Do you think it might be a good idea to allow people to pin specific version numbers? In case a third party dep is released with a bug or a breaking change without revving the major version?

@dryajov
Copy link
Member

dryajov commented May 21, 2018

Yeah, that sounds about right. Also, maybe we can even provide a whitelist override - some packages might overload the ^ and ~ meaning with something else.

@achingbrain
Copy link
Member Author

I've added a new commit that allows pinned versions (e.g. "my-dep": "1.2.3"), this should allow us to swerve any unintended breaking changes from third party dependencies.

Our JS code guidelines say we should use `~` as a prefix for pre-v1 dependencies.  Sadly npm disagrees and uses `^` by default.

This PR adds a linting step that examines all dependencies and strenuously objects if it sees anything that violates the guidelines.

https://github.com/ipfs/community/blob/master/js-code-guidelines.md#dependency-versions

feat: allow pinned versions for dependencies

also refactors tests to test more scenarios
@victorb
Copy link
Member

victorb commented May 22, 2018

Nice! Thanks

@victorb victorb merged commit 54b21ae into master May 22, 2018
@ghost ghost removed the status/in-progress In progress label May 22, 2018
@daviddias daviddias deleted the lint-package-json-dep-versions branch May 23, 2018 10:02
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.

4 participants