-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Flow: fix errors in 'flatMap.js' on old Flow versions #2137
Conversation
@@ -5,11 +5,14 @@ declare function flatMap<T, U>( | |||
fn: (item: T, index: number) => $ReadOnlyArray<U> | U, | |||
): Array<U>; | |||
|
|||
// Workaround to make older Flow versions happy | |||
const flatMapMethod = (Array.prototype: any).flatMap; |
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.
@jedwards1211 We enabled Flow warnings in config:
Line 35 in 8ab6524
include_warnings=true |
So flow generate warnings for ignored
$FlowFixMe
.It also possible that other projects using
include_warnings=true
So I decided to just use
any
since it works in all Flow versions.
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.
Gotcha, yeah the fact that ignore comments may not work when the package is used as a dependency is a real shortcoming of Flow right now
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.
I released 14.5.4
📦 with this fix included.
Sorry for the delay.
Fixes #2136