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

import/no-unresolved on NX monorepos on 4.x #393

Open
keeban-io opened this issue Mar 18, 2025 · 3 comments
Open

import/no-unresolved on NX monorepos on 4.x #393

keeban-io opened this issue Mar 18, 2025 · 3 comments

Comments

@keeban-io
Copy link

Hi,

Looks like #376 is resolved by #377 and deployed in 3.x codebase, but it's not patched on main 4.x, as whole config resolving logic is rewritten.

I'd appreciate any help. Thanks!

@JounQin
Copy link
Collaborator

JounQin commented Mar 18, 2025

Please provide reproduction.

v4 is confirmed resolves #376.

@prenaissance
Copy link

prenaissance commented Mar 23, 2025

I confirm that this happens for pnpm workspaces using import-x as well. The same configuration produces import-x/no-unresolved and import-x/order errors on version 4 and no errors on version 3.

Here's my eslint configuration.

To reproduce, clone this repo and checkout to the commit from the hyperlink, run pnpm add -Dw eslint-import-resolver-typescript@latest and then pnpm -w lint and observe the newly appeared eslint errors.

Logs: Version `@4` logs:
/home/prenaissance/Repos/omni-index/apps/backend/src/atproto/types/com/omni-index/comment.ts
  4:28  warning  'BlobRef' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  5:10  warning  'CID' is defined but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars

/home/prenaissance/Repos/omni-index/apps/backend/src/atproto/types/com/omni-index/comment/like.ts
  4:28  warning  'BlobRef' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  5:10  warning  'CID' is defined but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/components/ui/button.tsx
  5:20  error  Unable to resolve path to module '~/lib/utils'  import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/components/ui/input.tsx
  3:20  error  Unable to resolve path to module '~/lib/utils'  import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/components/ui/label.tsx
  5:20  error  Unable to resolve path to module '~/lib/utils'  import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/routes/book.tsx
  3:21  error  Unable to resolve path to module '~/lib/env'              import-x/no-unresolved
  4:19  error  Unable to resolve path to module '~/components/ui/popup'  import-x/no-unresolved
  5:29  error  Unable to resolve path to module '~/lib/formats'          import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/routes/home.tsx
  2:22  error  Unable to resolve path to module '~/components/trending'  import-x/no-unresolved
  3:18  error  Unable to resolve path to module '~/components/hero'      import-x/no-unresolved
  4:21  error  Unable to resolve path to module '~/lib/env'              import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/routes/login.tsx
  2:24  error  Unable to resolve path to module '~/components/ui/button'  import-x/no-unresolved
  3:23  error  Unable to resolve path to module '~/components/ui/input'   import-x/no-unresolved
  4:23  error  Unable to resolve path to module '~/components/ui/label'   import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/server/routes/oauth/callback.ts
  1:10  warning  'redirect' is defined but never used. Allowed unused vars must match /^_/u       @typescript-eslint/no-unused-vars
  3:21  error    Unable to resolve path to module '~/server/env'                                  import-x/no-unresolved
  6:25  warning  'host' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/server/routes/oauth/login.ts
  3:21  error  Unable to resolve path to module '~/server/env'  import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/scrapers/common/gutenberg.ts
  1:36  error  Unable to resolve path to module '~/backend/media/payloads/entry/create-entry-request'                    import-x/no-unresolved
  2:1   error  `./utilities` import should occur before import of `~/backend/media/payloads/entry/create-entry-request`  import-x/order

/home/prenaissance/Repos/omni-index/apps/scrapers/scripts/import-gutenberg-batch.ts
  2:36  error  Unable to resolve path to module '~/backend/media/payloads/entry/create-entry-request'  import-x/no-unresolved
  3:48  error  Unable to resolve path to module '~/common/gutenberg'                                   import-x/no-unresolved

/home/prenaissance/Repos/omni-index/apps/scrapers/scripts/import-gutenberg.ts
  3:48  error  Unable to resolve path to module '~/common/gutenberg'  import-x/no-unresolved

✖ 25 problems (19 errors, 6 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Version @3 logs:

/home/prenaissance/Repos/omni-index/apps/backend/src/atproto/types/com/omni-index/comment.ts
  4:28  warning  'BlobRef' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  5:10  warning  'CID' is defined but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars

/home/prenaissance/Repos/omni-index/apps/backend/src/atproto/types/com/omni-index/comment/like.ts
  4:28  warning  'BlobRef' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  5:10  warning  'CID' is defined but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars

/home/prenaissance/Repos/omni-index/apps/frontends/omni-book/app/server/routes/oauth/callback.ts
  1:10  warning  'redirect' is defined but never used. Allowed unused vars must match /^_/u       @typescript-eslint/no-unused-vars
  6:25  warning  'host' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 6 problems (0 errors, 6 warnings)

@JounQin
Copy link
Collaborator

JounQin commented Mar 24, 2025

Thanks for reproduction, I'll take a look soon.

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

3 participants