Skip to content

Conversation

jablko
Copy link
Contributor

@jablko jablko commented Sep 21, 2021

I overlooked the second moduleVisitor callback parameter (the ImportDeclaration/ImportExpression) in #2220. Doesn't make a functional difference, just tidier than recovering node from node.source:

checkSourceValue(node.source, node);

@@ -162,7 +162,6 @@ function reportIfMissing(context, deps, depsOptions, node, name) {
// Do not report when importing types
if (
node.importKind === 'type' ||
(node.parent && node.parent.importKind === 'type') ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relatedly this was introduced here and rendered obsolete here, I think.

This comment is describing node.source, which is what node used to be, prior to #1237. That requires the node.parent.importKind term. After, it's the ImportDeclaration/ImportExpression, which satisfies the node.importKind term instead.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants