Merged
Conversation
johnnyreilly
approved these changes
Oct 3, 2017
Contributor
|
@sandersn Please fix the failures indicated in the Travis CI log. |
alloy
approved these changes
Oct 3, 2017
types/bootbox/index.d.ts
Outdated
| interface BootboxBaseOptions<T = any> { | ||
| title?: string | Element; | ||
| callback?: (result: boolean | string) => any; | ||
| callback?: (result: T) => any; |
Member
There was a problem hiding this comment.
Nit: fix the indentation here.
Contributor
Author
There was a problem hiding this comment.
Huh, I didn't think anybody used tabs in DT. Fixed.
| append<T, U>(el: U, list: T[]): Array<(T & U)>; | ||
| append<U>(el: U): <T>(list: T[]) => Array<(T & U)>; | ||
| append<U>(el: U): <T>(list: T[]) => Array<(T & U)>; | ||
| append<T, U>(el: U, list: T[]): Array<(T & U)>; |
Member
There was a problem hiding this comment.
Why is this not Array<T | U>? I guess it was already written this way...
wat
Contributor
Author
|
Note that Travis only gets half way through tests before timing out. I assume that's because I change node and react and jquery. I ran the tests locally and found a couple of failures that I fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates popular packages to work with the upcoming
"strictFunctionTypes": trueoption in the upcoming Typescript 2.6 (microsoft/TypeScript#18654). When this flag is on, the compiler determines whether type parameters should be related covariantly, contravariantly or invariantly and enforces this except for methods. (Methods are an exception because they are so commonly incorrect.)The fixes fall into 4 categories:
Because methods are exempt from this check, the type
(a?: number) => objectcan be rewritten as{ bivarianceHack(a?: number) => object }['bivarianceHack']. The second type is identical in almost every way, except that it is related bivariantly — unsafely. I only used this hack to fix backbone and react, where I believe the pattern is intended even if it's unsafe.