Skip to content

import/no-unresolved unable to resolve @atlaskit/pragmatic-drag-and-drop’s nested imports after upgrading 3.8.7 → 4.2.4 #409

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

Closed
acusti opened this issue Mar 26, 2025 · 8 comments · Fixed by unrs/unrs-resolver#75

Comments

@acusti
Copy link

acusti commented Mar 26, 2025

i am using @atlassian/pragmatic-drag-and-drop, which exposes a number of nested import targets. when i upgrade eslint-import-resolver-typescript from 3.8.7 to 4.2.4, i get errors when trying to import from any of those targets:

Error:    1:25  error  Unable to resolve path to module '@atlaskit/pragmatic-drag-and-drop/combine'            import/no-unresolved
Error:    5:8   error  Unable to resolve path to module '@atlaskit/pragmatic-drag-and-drop/external/adapter'   import/no-unresolved
Error:    9:8   error  Unable to resolve path to module '@atlaskit/pragmatic-drag-and-drop/external/file'      import/no-unresolved
Error:   10:34  error  Unable to resolve path to module '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled'  import/no-unresolved

here are the lines in question:

import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
import {
    dropTargetForExternal,
    monitorForExternal,
} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';
import {
    containsFiles,
    getFiles,
} from '@atlaskit/pragmatic-drag-and-drop/external/file';
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';

using v3.8.7, there are no linting errors. i am using v1.5.2 of @atlaskit/pragmatic-drag-and-drop. my eslint.config.js file configures the import/resolver like so:

            'import/resolver': { typescript: { alwaysTryTypes: true } },

and i am using eslint v9.23.0

let me know if there’s anything else that would be useful for me to provide, and thanks for this excellent project! i had a lot of struggles with eslint and typescript and the import/* eslint rules before finding it and getting it configured correctly.

@JounQin
Copy link
Collaborator

JounQin commented Mar 26, 2025

Please provide a GitHub repository reproduction.

@JounQin
Copy link
Collaborator

JounQin commented Mar 26, 2025

Image

Just a quick look, it seems resolving package.json is not supported by oxc-resolver currently.

cc @Boshen

I'll try whether can fix it by myself.

JounQin added a commit that referenced this issue Mar 28, 2025
JounQin added a commit that referenced this issue Mar 28, 2025
JounQin added a commit that referenced this issue Mar 28, 2025
@JounQin
Copy link
Collaborator

JounQin commented Mar 28, 2025

@acusti I can't reproduce it at #416, please provide reproduction.

JounQin added a commit that referenced this issue Mar 28, 2025
JounQin added a commit that referenced this issue Mar 28, 2025
@JounQin
Copy link
Collaborator

JounQin commented Mar 29, 2025

Closing due to lack of reproduction, feel free to provide a reproduction, then I'll take a look again.

@JounQin JounQin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2025
@acusti
Copy link
Author

acusti commented Apr 15, 2025

@JounQin sorry for the delay. i finally put together a minimal reproducible example: https://github.com/acusti/eslint-import-resolver-typescript-repro

it’s using latest yarn (v4.9.1) and PnP, but i’m not sure if that’s required to make it reproducible. it might be only reproducible from a tsx file, because my initial attempt to make a reproduction that didn’t include react didn’t trigger an error.

@JounQin JounQin reopened this Apr 15, 2025
@JounQin
Copy link
Collaborator

JounQin commented Apr 15, 2025

Thanks for providing the reproduction, I'll take a look when I'm free, or contributing will be much appreciated.

@JounQin
Copy link
Collaborator

JounQin commented Apr 21, 2025

OK, seems related to P'n'P support. If I changed to use nodeLinker: node-modules, there will be no issue.

@JounQin
Copy link
Collaborator

JounQin commented Apr 21, 2025

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

Successfully merging a pull request may close this issue.

2 participants