Civet icon indicating copy to clipboard operation
Civet copied to clipboard

Extending import renaming shortcut `exportedName: importedName` to `export from`

Open esthedebeste opened this issue 1 year ago • 1 comments
trafficstars

Input code

export { s: t } from ./stuff

Expected output

export { s as t } from "./stuff"

playground link

esthedebeste avatar Mar 07 '24 08:03 esthedebeste

This seems to be a little tricky to unify with object notation since:

{ s: t } from ./stuff makes sense as s as t but:

export { s: t } makes more sense as export { t as s }

The challenge comes when combining them in the same statement it depends on if viewing the object as part of the export or import; lhs/rhs to determine which order they should go in.

Or maybe I'm overthinking it and : is just a shorthand for as in this context.

STRd6 avatar Mar 07 '24 16:03 STRd6