Skip to content

Commit 6dc8a21

Browse files
committed
fix namespace import
1 parent 409cb9b commit 6dc8a21

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/cli/src/languagesPlugins/javascript.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ class JavascriptPlugin implements LanguagePlugin {
6060
}
6161

6262
// remove the other annotations
63-
let nextNode = node.nextNamedSibling;
64-
// We need to remove all decorators too
65-
while (nextNode && nextNode.type === "decorator") {
66-
nextNode = nextNode.nextNamedSibling;
67-
}
63+
const nextNode = node.nextNamedSibling;
6864
if (!nextNode) {
6965
throw new Error("Could not find next node");
7066
}
@@ -597,6 +593,12 @@ class JavascriptPlugin implements LanguagePlugin {
597593

598594
// Validate each import identifier
599595
depImport.identifiers.forEach((depImportIdentifier) => {
596+
if (depImportIdentifier.type === "namespace") {
597+
// TODO for namespace import, need to go deeper in the code to see if their usage is valid.
598+
// For now, we just assume they are always valid
599+
return;
600+
}
601+
600602
const isValid = depExport.some((dep) => {
601603
// Check if the identifier matches a default export
602604
if (

0 commit comments

Comments
 (0)