Import default syntax

# Ian MacLeod (10 years ago)

(I would have expected this to have been bikeshedded to death already; but search is failing me?)

For me, the import syntax is very readable, except for importing default exports. I.e. import name from "module"

My main beef is that it just doesn't make sense from an English standpoint: I'm not importing name from "module" - I'm importing the default export from "module" as name.

Couple alternative ideas (even if it's too late to propose anything...):

  • import "module" as name; Seems better. Though, it isn't entirely clear that you're getting the default export (as opposed to being sugar for import
  • as name from "module";)
  • import . as name from "module"; where . is just sugar for default.