Skip to content

import-x/no-unresolved does not work in vscode eslint with monorepo #451

@air2

Description

@air2

Hello when I use absolute paths in a mono repo, the import-x/no-unresolved says the file is not resolvable when I first open an file from an other package with absolute imports so: I have:

packages\backend\eslint.config.mjs
packages\backend\src\file1.ts
packages\backend\src\file2.ts
packages\shared\eslint.config.mjs
packages\shared\src\some.ts
packages\shared\src\other.ts

file1.ts

import { something } from "src/file2.ts"

some.ts

import { something } from "src/other.ts"

When I open file1.ts no errors. When I open some.ts, it says src/other.ts is not resolvable. However if I restart visual code, and I open some.ts first, it shows no errors, when I now open file1.ts it says the import is not resolvable.
When I run eslint on both projects there are no linting errors.

I am not sure what is causing this bug, but I only see it happening with this rule, so therefor I issues a bug here first. Also I am not sure what kind of information could help to resolve this. So if I need to add any other kind of info, or if you got any other hints as how to debug this, that would be great.

For now I disable the rule in the .vscode/settings.json:

  "eslint.rules.customizations": [
    {
      "rule": "import-x/no-unresolved",
      "severity": "off"
    }
  ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions