Only named exports may use 'export type'.
FezVrasta opened this issue · 9 comments
With 0.1.9 the following code would be converted as follows:
JS:
// @flow
export type * from './types';
TS:
export * from './types';
But with 0.2.2 I get the following:
export type * from "./types";
which results in a TS error:
lib/index.d.ts:1:1 - error TS1383: Only named exports may use 'export type'.
1 export type * from "./types";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Related to microsoft/TypeScript#37238
I'm completely TypeScript noob so sorry for the question, does export * from './types'
work in TS or it's only exporting JS modules that way?
export * from './types'
exports everything including the types. Unfortunately, TypeScript doesn't support export type *
now, and so export *
should be used to solve this flow-to-ts
issue.
I think this broken the functionality. I'm not sure what the commit is trying to achieve considering TS doesn't support it?
TypeScript supports all the other syntaxes. It only doesn't support export type *
, which is an inconsistency from the typescript compiler.
@FezVrasta yeah, I messed up with that commit. I should've converted typeof
imports to kind
imports. I didn't know that export type *
was even a thing that flow supported. There also needs to be way more test cases for all of the different kinds of imports and exports.
Please have a look at #229 and let me know if I missed any cases.
I've published v0.3.0 with the import/export improvements.
Works great, thanks!