-
Notifications
You must be signed in to change notification settings - Fork 75
Type aliases don't work as object indexes - crash bug #152
Comments
It would be an improvement if it just assumed the type is always |
I think we should try to convert the types as closely as possible. Changing a type alias to |
Ultimately I did my typescript conversion using flowts. This guy maintains his own fork of babel-plugin-flow-to-typescript which is more up-to-date with bug fixes and support for new typescript 3.8 syntax. Also, |
This is still an issue when running |
This looks like it was introduced sometime around babel 7.6. If I add the following to my package.json: "resolutions": {
"**/flow-to-ts/@babel/types": "< 7.6.0"
} flow-to-ts is able to convert indexer properties like this - input: // @flow
type KK = ("foo"|"bar")
export type X = { [k: KK]: string} output: type KK = "foo" | "bar";
export type X = { [k in KK]?: string }; |
@jdelStrother interesting. I've been meaning to update some of the dependencies. I'm glad to see doing so fixes some issues. |
Sorry, I wasn't clear. This used to work fine, but broke in Babel 7.6 or above 😞 |
If I make a file with only this in it:
And run the tool on it, this happens:
I suppose #108 didn't fix this.
The text was updated successfully, but these errors were encountered: