Skip to content

Commit

Permalink
fix: no-unresolved check import() (fixes #2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Apr 12, 2021
1 parent e871a9a commit 8424548
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions utils/moduleVisitor.js
Expand Up @@ -36,10 +36,7 @@ exports.default = function visitModules(visitor, options) {

// for esmodule dynamic `import()` calls
function checkImportCall(node) {
if (node.callee.type !== 'Import') return;
if (node.arguments.length !== 1) return;

const modulePath = node.arguments[0];
const modulePath = node.source;
if (modulePath.type !== 'Literal') return;
if (typeof modulePath.value !== 'string') return;

Expand Down Expand Up @@ -86,7 +83,7 @@ exports.default = function visitModules(visitor, options) {
'ImportDeclaration': checkSource,
'ExportNamedDeclaration': checkSource,
'ExportAllDeclaration': checkSource,
'CallExpression': checkImportCall,
'ImportExpression': checkImportCall,
});
}

Expand Down

0 comments on commit 8424548

Please sign in to comment.