Skip to content

TS transform: TSImportEqualsDeclaration in namespace is not transformed #8384

@overlookmotel

Description

@overlookmotel

Input:

import Original from 'foo';

namespace foo {
  import Alias = Original;
  console.log(Alias);
}

Expected output:

import Original from 'foo';
var foo;
(function (foo) {
  var Alias = Original;
  console.log(Alias);
})(foo || (foo = {}));

TS Playground
Babel REPL

Actual output:

import Original from "foo";
let foo;
(function(_foo) {
  console.log(Alias);
})(foo || (foo = {}));

Oxc playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-transformerArea - Transformer / TranspilerC-bugCategory - Bug

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions