-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
import foo = bar
Configuration file name
No response
Configuration
No response
Current and expected behavior
plugin-transform-typescript fails to register the declaration at
path.replaceWith(
t.variableDeclaration("var", [
t.variableDeclarator(
path.node.id,
entityNameToExpr(path.node.moduleReference),
),
]),
);
in packages/babel-plugin-transform-typescript/src/index.ts.
Environment
@babel/plugin-transform-typescript: 7.20.13
Possible solution
Insert
path.scope.registerDeclaration(path);
after this line:
Additional context
No response
Metadata
Metadata
Assignees
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue