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

feat(schemas)!: improve TS array types #26172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Mar 10, 2025

Summary

Refines our TypeScript array types to account for minItems.

E.g. string | [string, string, ...string[]] guarantees that if the value is an array, then the first two values are string, rather than string | undefined.

Important

This is a breaking change.

Test results and supporting details

Related issues

Make the minItems explicit in our TypeScript types.
@github-actions github-actions bot added schema Isses or pull requests regarding the JSON schema files used in this project. infra Infrastructure issues (npm, GitHub Actions, releases) of this project linter Issues or pull requests regarding the tests / linter of the JSON files. bulk_update An update to a mass amount of data, or scripts/linters related to such changes scripts Issues or pull requests regarding the scripts in scripts/. size:m [PR only] 25-100 LoC changed labels Mar 10, 2025
@caugner caugner added the semver-major-bump A change that is potentially breaking for consumers label Mar 10, 2025
@caugner caugner requested review from queengooborg and Elchi3 March 10, 2025 18:19
@caugner
Copy link
Contributor Author

caugner commented Mar 10, 2025

@queengooborg @Elchi3 I'll bring this up tomorrow, but if you peek before, feel free to let me know what you think about this change. Basically, this restricts our array types.

@caugner caugner added the meeting agenda Issues or pull requests in need of discussion in a project meeting. label Mar 17, 2025
@caugner
Copy link
Contributor Author

caugner commented Mar 21, 2025

@ddbeck We quickly discussed this on Tuesday, and there were no concerns. What do you think about this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bulk_update An update to a mass amount of data, or scripts/linters related to such changes infra Infrastructure issues (npm, GitHub Actions, releases) of this project linter Issues or pull requests regarding the tests / linter of the JSON files. meeting agenda Issues or pull requests in need of discussion in a project meeting. schema Isses or pull requests regarding the JSON schema files used in this project. scripts Issues or pull requests regarding the scripts in scripts/. semver-major-bump A change that is potentially breaking for consumers size:m [PR only] 25-100 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant