When trying to export a type after its declaration with Typescript 3.8+:
type Type = { Prop: string };
export { Type }
... VS Code gives the following error:
Re-exporting a type when the
--isolatedModuls
flag is provided requires usingexport type
So I did as the error suggests:
type Type = { Prop: string };
export type { Type }
However, that caused another error, emitted by eslint:
Parsing error: Declaration or statement expected.
2 questions:
- Why is it considered "re-exporting"?
- Isn't this kind of export allowed on Typescript 3.8+, with
--isolatedModuls
flag on, as explained here?