-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Support for v0.42 Object type spread #207
Comments
There's an issue open in Babylon (the parser) for this, should be out soon babel/babylon#418. |
The issue is merged but I still get |
It's been merged into Babylon v7, which isn't released yet. |
It seems like it should be possible to support this in the plugin. When I tried to look into this it seems like it could be supported by updating to babel-eslint v7.2.3 and to check if the type of the identifierNode is This is assuming that we don't want to include spread identifiers in the duplicate key check. Would that makes sense since it's not a key? If we want to include spread identifiers in the duplicate check we would have to decide if we should allow the same identifier just with different refinements. Then its should just be a matter of handling it in https://github.com/gajus/eslint-plugin-flowtype/blob/master/src/utilities/getParameterName.js. One problem is that updating to babel-eslint v7.2.3 seems to break several of the
Haven't had time yet to investigate why this happens. |
The babylon fix was backported to 6, so this should be possible to fix in eslint-plugin-flowtype. Upgrading babel-eslint to 7.2.3 and running on a simple check causes an error. I'm using babel-core@6.25 and babel-eslint@7.2.3. type Props = {
foo: string
}
type OtherProps = {
...Props
} output of eslint
I tried opening this in chrome dev tools and I see that there is indeed no |
Version v0.42 of flow comes with support for object type spread (type TypeB = { ...TypeA };)
I currently get "Parsing error: Unexpected token"
It would have been great with support for this.
The text was updated successfully, but these errors were encountered: