benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.95k stars 346 forks source link

fix: print ExportSpecifier.exportKind #1338

Closed ashsearle closed 1 year ago

ashsearle commented 1 year ago

This fixes a small oversight: ExportSpecifier supports exportKind in a similar fashion to ImportSpecifier supporting importKind, but the print logic was missing.

Without this change it's impossible to generate an ExportNamedDeclaration containing a mix of type and value exports.

See this broken jscodeshift example in AST Explorer

This is in the spirit of changes described in the original type-only PR for TypeScript, as well as changes for SWC in 1.2.92

eventualbuddha commented 1 year ago

Published in v0.23.3.