Skip to content

Comments

fix: False-positive no-extraneous-import when using the tsconfig > paths alias import#408

Merged
aladdin-add merged 2 commits intoeslint-community:masterfrom
MorevM:master
Feb 23, 2025
Merged

fix: False-positive no-extraneous-import when using the tsconfig > paths alias import#408
aladdin-add merged 2 commits intoeslint-community:masterfrom
MorevM:master

Conversation

@MorevM
Copy link

@MorevM MorevM commented Feb 15, 2025

Closes #379

I decided to be as minimalistic as possible in the changes (still, it fixes the problem) :)

The original solution proposed in the issue didn't work for me, because calculating resolverConfig depends on moduleType, but calculating the correct moduleType requires partially filling resolverConfig (in particular resolverConfig.alias), which would result in calling a separate method twice, which is obviously less performant, so I just inserted the necessary check into the getModuleType definition.

@MorevM
Copy link
Author

MorevM commented Feb 15, 2025

The falling type test is not caused by this change, and I honestly have little desire to fix it :)

@aladdin-add
Copy link

Yes, the master branch is also failing (it may be due to recent eslint type changes). I'll try to investigate it later.

Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aladdin-add aladdin-add merged commit f486492 into eslint-community:master Feb 23, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: no-extraneous-import does not work correctly with tsconfig.json paths that start with ~ or @

2 participants