Skip to content

Commit dd81424

Browse files
jablkoljharb
authored andcommitted
[Refactor] no-unresolved, no-extraneous-dependencies: moduleVisitor usage
1 parent 4f0f560 commit dd81424

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1919
### Changed
2020
- [Refactor] switch to an internal replacement for `pkg-up` and `read-pkg-up` ([#2047], thanks [@mgwalker])
2121
- [patch] TypeScript config: remove `.d.ts` from [`import/parsers` setting] and [`import/extensions` setting] ([#2220], thanks [@jablko])
22+
- [Refactor] [`no-unresolved`], [`no-extraneous-dependencies`]: moduleVisitor usage ([#2233], thanks [@jablko])
2223

2324
## [2.24.2] - 2021-08-24
2425

@@ -914,6 +915,7 @@ for info on changes for earlier releases.
914915

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

918+
[#2233]: https://github.com/import-js/eslint-plugin-import/pull/2233
917919
[#2226]: https://github.com/import-js/eslint-plugin-import/pull/2226
918920
[#2220]: https://github.com/import-js/eslint-plugin-import/pull/2220
919921
[#2219]: https://github.com/import-js/eslint-plugin-import/pull/2219

Diff for: src/rules/no-extraneous-dependencies.js

-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ function reportIfMissing(context, deps, depsOptions, node, name) {
162162
// Do not report when importing types
163163
if (
164164
node.importKind === 'type' ||
165-
(node.parent && node.parent.importKind === 'type') ||
166165
node.importKind === 'typeof'
167166
) {
168167
return;

Diff for: src/rules/no-unresolved.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ module.exports = {
2626
create(context) {
2727
const options = context.options[0] || {};
2828

29-
function checkSourceValue(source) {
29+
function checkSourceValue(source, node) {
3030
// ignore type-only imports
31-
if (source.parent && source.parent.importKind === 'type') {
31+
if (node.importKind === 'type') {
3232
return;
3333
}
3434

0 commit comments

Comments
 (0)