Skip to content

import/no-unresolved if tsconfig from references is extended #400

Open
@nikitayutanov

Description

@nikitayutanov

The 4.x release was intended to rework tsconfig with specified references. Everything works as expected unless one of the referenced configs extends another config.

Reproduction

Here’s a repository with a quick reproduction of the issue. The main tsconfig.json references both tsconfig.app.json and tsconfig.node.json.

However, since tsconfig.app.json extends tsconfig.base.json, running the eslint CLI results in an import/no-unresolved error.

This issue persists unless multiple projects are explicitly specified in eslint.config.js.

Real-World Use Case

While this may seem redundant, a real-world scenario would involve tsconfig.app.json extending a config provided by an external package rather than a locally defined one. For example:

{
  "extends": "@tsconfig/recommended/tsconfig.json"
}

This is particularly useful because it is currently not possible to inherit a single main config when using references.


Is this the intended behavior? It seems there are differences in how extended tsconfig files are handled when specified in the main config references.

Feel free to let me know if you need further adjustments, and thanks for your efforts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions