import { another as _imp } from "..";
var x = _imp();
It should be:
import _imp from ".."; // or: import * as _imp from "..";
var x = _imp.another();
This strange behavior is because a require(..).whatever is a recognized MemberExpression, but itself can be the callee of a CallExpression. It might technically work the way it currently is, but it's pretty unintuitive. I think the specificity of trying to import the named-export (another), instead of the whole module/namespace, is the problem, and should be pulled back.
Currently becomes:
It should be:
This strange behavior is because a
require(..).whatever
is a recognizedMemberExpression
, but itself can be the callee of aCallExpression
. It might technically work the way it currently is, but it's pretty unintuitive. I think the specificity of trying to import the named-export (another
), instead of the whole module/namespace, is the problem, and should be pulled back.