Skip to content

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

Merged
ljharb merged 1 commit into
import-js:masterfrom
rperello:origin/fix-is-scoped
Aug 4, 2021
Merged

[Fix] extensions/importType: fix isScoped treating @/abc as scoped module#2146
ljharb merged 1 commit into
import-js:masterfrom
rperello:origin/fix-is-scoped

Conversation

@rperello

@rperello rperello commented Jul 6, 2021

Copy link
Copy Markdown

Closes #2145

Comment thread .vscode/settings.json Outdated
@ljharb
ljharb force-pushed the origin/fix-is-scoped branch from cc1d442 to 00d7bc8 Compare August 3, 2021 19:58
@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

ykzts commented Oct 7, 2021

Copy link
Copy Markdown

@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

ljharb commented Oct 7, 2021

Copy link
Copy Markdown
Member

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

ykzts commented Oct 7, 2021

Copy link
Copy Markdown

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

ljharb commented Oct 7, 2021

Copy link
Copy Markdown
Member

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

ykzts commented Oct 7, 2021

Copy link
Copy Markdown

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