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

Unexpected error import/no-extraneous-dependencies #246

Open
ken1987 opened this issue Oct 5, 2023 · 4 comments
Open

Unexpected error import/no-extraneous-dependencies #246

ken1987 opened this issue Oct 5, 2023 · 4 comments

Comments

@ken1987
Copy link

ken1987 commented Oct 5, 2023

Details

It is possible to infer the workspace based on the second parameter file in getMappedPath. Once the workspace is inferred, the paths collection will never exceed two paths. This modification can help resolve the issue.

pr: ken1987@d1f85dd

ken1987 added a commit to ken1987/eslint-import-resolver-typescript that referenced this issue Oct 5, 2023
@JounQin
Copy link
Collaborator

JounQin commented Oct 5, 2023

Can you please raise a PR instead?

@woodreamz
Copy link

Is there any workaround until it's fixed?

@JounQin
Copy link
Collaborator

JounQin commented Dec 6, 2023

Can anyone provide an online runnable reproduction? I don't quite understand what's the issue here.

@guilhermetod
Copy link

guilhermetod commented Apr 30, 2024

@JounQin This repo might reproduce the issue. I'm not sure if that's the same cause from them, but for me it's not clear if the behavior is intentional or not.

To reproduce:

  • Open website/index.ts and initially there will be no issues
  • Add a package.json under website (touch ./website/package.json)
  • Two things will change:
  1. import { one } from '@common' will now be placed on the top by ESlint as it's not read as an internal module, but rather as an external/extraneous
  2. import { one } from '@common' will get an ESLint error (tests is the name defined on root package.json file):

image

https://github.com/guilhermetod/eslint-resolver-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants