-
-
Notifications
You must be signed in to change notification settings - Fork 209
Flowtype's new object spread gives parsing error #443
Comments
This is an issue in babylon which does not support this syntax yet. |
@danez Babylon issue was fixed! |
The Babylon issue was fixed, but only in The nasty workaround is to use the comment-style Flow type: export type A = {a: string}
export type B = {b: number}
/* :: type _C = {...A, ...B} */
export type C = _C |
It’s a bit less ugly if you just comment out the spread type: export type C = {
/* :: ...A, */
/* :: ...B, */
} |
The other possible fix is this: Now, in your main project, get rid of existing babel-eslint via After that ensure that 1) eslint still works on your project 2) you can use object spread syntax without any further problems!
|
Actually, this should no longer be required as the change has also been backported to babylon 6.x: babel/babylon#476 Furthermore, a specific fix for this has been applied to babel-eslint: #465 So all we need is a new babel-eslint release, for which even the version number update has already been made: 94bb5a1 But the actual release has not yet been made. @zertosh @kittens @danez do you have more info? |
@mjomble , everything worked from yarn:
That installed a 7.2.3 version, not sure why, because that tag is not present in a github repo. |
Ah, weird, I guess the new release was pushed to npm, but wasn't created on Github. |
@lgraziani2712 Same issue! |
****, I removed the comment sorry! I said that @ZeusTheTrueGod comment solved the babel-eslint issue but I get a new one. BTW, that new one is related to |
It seems like we need a babel 7 in a webpack in order to get this working. Only babel 7 depends on a babylon 7! |
Uhmm, I just disabled Edit: reported jsx-eslint/eslint-plugin-react#1178 |
Ok, so here is what I've found - if you don't have an up-to date |
If anyone can spot the error in my attempt, please let me know, here is a repo: |
@rosskevin I'm experiencing the same issue, and opened a ticket for it here: I still believe that it is not fully supported in 6.25.0 |
Flowtype's new feature, type object spread isn't getting parsed properly: facebook/flow@ad443dc
Example:
The text was updated successfully, but these errors were encountered: