Add return type to improve type coverage#15
Conversation
|
Is it still relevant? (I know flow also fixed some bugs with coverage reporting). |
afb582e to
6507227
Compare
|
@andreypopp sorry for disappearing! It appears to still be relevant. I'm trying to put together a simple reproduction here. I'm running into a problem though with I'm a little puzzled at the moment and haven't been able to put a lot of cycles towards addressing it yet. I suspect it has to do with a recent version of Flow (currently 0.70.0). I will try downgrading and seeing if I can move forward from there. |
|
Downgrading to |
|
Okay I've updated the PR that adds some type coverage that ultimately provides the needed coverage for the test repo to work at full coverage as well. This is ready again for review. |
|
|
||
| type Refine<A, B> = (value: A, error: (message: GenericMessage) => void) => B; | ||
| // Maybe this should be Error instead of mixed? | ||
| type Refine<A, B> = (value: A, error: (message: GenericMessage) => mixed) => B; |
There was a problem hiding this comment.
I'm curious what you think here. Error maybe?
e96d169 to
4a9bd9a
Compare
3cd2942 to
f338de3
Compare
The project I work on has a requirement for 100% type coverage. When making my own custom validators, I noticed properties hanging off
contextweren't something Flow could infer (they becomeany). Adding this return type is enough for Flow to achieve type coverage with usage ofcontext.