Skip to content

Commit

Permalink
[Refactor] no-unresolved, no-extraneous-dependencies: moduleVisit…
Browse files Browse the repository at this point in the history
…or usage
  • Loading branch information
jablko authored and ljharb committed Sep 21, 2021
1 parent 4f0f560 commit dd81424
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
### Changed
- [Refactor] switch to an internal replacement for `pkg-up` and `read-pkg-up` ([#2047], thanks [@mgwalker])
- [patch] TypeScript config: remove `.d.ts` from [`import/parsers` setting] and [`import/extensions` setting] ([#2220], thanks [@jablko])
- [Refactor] [`no-unresolved`], [`no-extraneous-dependencies`]: moduleVisitor usage ([#2233], thanks [@jablko])

## [2.24.2] - 2021-08-24

Expand Down Expand Up @@ -914,6 +915,7 @@ for info on changes for earlier releases.

[`memo-parser`]: ./memo-parser/README.md

[#2233]: https://github.com/import-js/eslint-plugin-import/pull/2233
[#2226]: https://github.com/import-js/eslint-plugin-import/pull/2226
[#2220]: https://github.com/import-js/eslint-plugin-import/pull/2220
[#2219]: https://github.com/import-js/eslint-plugin-import/pull/2219
Expand Down
1 change: 0 additions & 1 deletion src/rules/no-extraneous-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') ||
node.importKind === 'typeof'
) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ module.exports = {
create(context) {
const options = context.options[0] || {};

function checkSourceValue(source) {
function checkSourceValue(source, node) {
// ignore type-only imports
if (source.parent && source.parent.importKind === 'type') {
if (node.importKind === 'type') {
return;
}

Expand Down

0 comments on commit dd81424

Please sign in to comment.