-
Notifications
You must be signed in to change notification settings - Fork 30k
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
[@types/prop-types] Add support of as const
to oneOf
#34706
[@types/prop-types] Add support of as const
to oneOf
#34706
Conversation
@ibezkrovnyi Thank you for submitting this PR! 🔔 @DovydasNavickas @ferdaber @eps1lon - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@ibezkrovnyi The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
IssueIssue is in TestedAfter reverting my changes (using master branch): typescript@3.4.3: ✔️ no issue @RyanCavanaugh could you please advise what should I do - while issue with recompose isn't related to this PR, Travis CI build of this PR failed |
|
|
Derp, I went the opposite way. Sounds good, thanks for the clarification! |
Removed non-consistent periods in JSDoc to trigger CI build |
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
I just published |
…ed#34706) * Add readonly modifier to oneOf definition * remove unnecessary periods, trigger ci build
Common way before microsoft/TypeScript#29510 was to use
tuple
trickAfter microsoft/TypeScript#29510 has landed we could use
as const
Some evidence
tuple
is pretty common approach, for example, it is used in ant.designChange
Change is to replace type
T[]
ofoneOf
parameter withReadonlyArray<T>
.This change relaxes requirement for an Array.
Tested
This change was tested on my project and I used
as const
in part of code location, while keeping old way for another part of code locations. Both old and new ways work fine.