-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enforce tilde ranges for packages with type definitions #6971
Conversation
a887fb1
to
cb5be70
Compare
Size Change: 0 B Total Size: 2.98 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the changes in this PRLighthouse tested 2 URLs Report for Article
Report for Front
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should reduce the need for adjusting things like #6967
fdbced7
to
a12762b
Compare
df51e7c
to
453ded8
Compare
Use tilde ranges for packages with a type definition, as this is what the contract from DefinitelyTyped expects https://github.com/DefinitelyTyped/DefinitelyTyped#how-do-definitely-typed-package-versions-relate-to-versions-of-the-corresponding-library https://github.com/npm/node-semver#tilde-ranges-123-12-1
17235e2
to
4727604
Compare
What does this change?
Enforce the
~
tilde range syntax for@types/*
packages and their matching source, as this is the only one that guarantees a matching version, as per the DefinitelyTyped contract.Leave @type packages without a source as-is.
Example of successful run: https://github.com/guardian/dotcom-rendering/actions/runs/3938014495/jobs/6736198283
Why?
Builds on top of #6966 for a stricter check and possibly enforce a CI check to fail
Mismatches in @types packages significantly reduce any type safety gained by using TypeScript.
Closes #6965
Example