babel-plugin-flow-to-typescript
babel-plugin-flow-to-typescript copied to clipboard
Error on FunctionType Conversion
i'm getting the following error: TypeError: Property parameters expected type of array but got object
when trying to convert some flow files. i've narrowed it down to the following code
// @flow
export type RolesProps = {
roles: Array<Role>,
activeRoles: Array<string>,
accountGuid: string,
setError: (string) => void,
setTooltip: (string) => void,
}
i think it is related to this line in the plugin: https://github.com/Kiikurage/babel-plugin-flow-to-typescript/blob/master/src/converters/convert_flow_type.ts#L330
commenting out those two function definitions results in a successful compilation
Hi @TomPridham
it looks issue is already fixed in master, but the version in npm is outdated
as a workaround, you can try using my fork @zxbodya/babel-plugin-flow-to-typescript
(latest version there should be the same as current master)
@Kiikurage can you publish a new version to npm?
great, that worked. thanks! should i close this or wait until a new version has been published?
I ran into the same problem today with this test code:
type xType = {|
data: number,
onClick: (e: string) => void // this is the problem line
|}