Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] no-unresolved, no-extraneous-dependencies: moduleVisitor usage #2233

Merged
merged 1 commit into from
Sep 22, 2021

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