Open stackptr opened 2 years ago
Using the TypeScript AST Viewer shows that in recent versions of typescript
(since at least 4.5.5
), the type
keyword in comma-separated imports does not show up as an ImportSpecifier
within NamedImports
. However, in the version closest to what is used by flowgen
, the AST contains an ImportSpecifier
for both type
and the named import. The only way I see to distinguish the two is by checking the name.originalKeywordKind
, which is ts.SyntaxKind.TypeKeyword
. Unfortunately, updating nodes/import.ts
to simply filter out these nodes does not do the job... the type
keyword needs to be preserved but not treated as an identifier itself.
flowgen
does not parse comma-separated type imports correctly. The following diff shows theimports.spec.ts
updated with this style of import and the resulting malformed import: