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 1 commit into from Sep 22, 2021


Copy link

@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

@jablko jablko Sep 21, 2021

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.


ljharb approved these changes Sep 21, 2021
Copy link

@ljharb ljharb left a comment

thanks, this is great


@ljharb ljharb changed the title [Refactor] no-unresolved: moduleVisitor usage [Refactor] no-unresolved, no-extraneous-dependencies: moduleVisitor usage Sep 21, 2021
@ljharb ljharb merged commit dd81424 into import-js:main Sep 22, 2021
94 of 95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants