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

[Fix] extensions/importType: fix isScoped treating @/abc as scoped module #2146

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

rperello
Copy link

@rperello rperello commented Jul 6, 2021

Closes #2145

.vscode/settings.json Outdated Show resolved Hide resolved
@ljharb ljharb changed the title [extensions]/importType: fix isScoped treating @/abc as scoped module [Fix] extensions/importType: fix isScoped treating @/abc as scoped module Aug 3, 2021
@ljharb ljharb merged commit 00d7bc8 into import-js:master Aug 4, 2021
@ykzts
Copy link

ykzts commented Oct 7, 2021

@ljharb With this change, @/pages (used in Next.js and Nuxt.js), which used to be treated as internal, is now recognized as unknown. Is it intentional that such a disruptive change is included in a minor version upgrade?

@ljharb
Copy link
Member

ljharb commented Oct 7, 2021

Yes, because it was a bug that it was treated as a valid package name in the first place. You can configure it with an import resolver.

@ykzts
Copy link

ykzts commented Oct 7, 2021

Hmm. import/order asks for the import type by value without resolver, so values like @/pages are always unknown. Is this not fixed in the eslint-plugin-import spec?

@ljharb
Copy link
Member

ljharb commented Oct 7, 2021

You’re right, that seems like a bug in the order rule - it should probably use the resolver to get the type. Can you file a new issue for that?

@ykzts
Copy link

ykzts commented Oct 7, 2021

Thank you very much. I created #2249.

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.

Set @/whatever import path as not scoped package
4 participants