Skip to content

language server ignores multiple tsconfig files #49210

@DetachHead

Description

@DetachHead

Bug Report

if a project has multiple tsconfig files (eg tsconfig.json and tsconfig.other.json) then the language server seems to ignore the one that isn't named tsconfig.json

🔎 Search Terms

language server multiple tsconfig

🕗 Version & Regression Information

4.8.0-dev.20220522

Playground github Link

https://github.com/DetachHead/typescript-nodejs-project/tree/global-types-issue

💻 Code

main config

// tsconfig.json
{
    "compilerOptions": {
        "target": "es3"
    },
    "include": ["src/main.ts"]
}
// src/main.ts
export {}

"".replaceAll // error

other config

// tsconfig.json
{
    "compilerOptions": {
        "target": "es2021"
    },
    "include": ["src/other.ts"]
}
export {}

"".replaceAll // error ???

🙁 Actual behavior

the following error in other.ts:

Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.

image

🙂 Expected behavior

no error when accessing the globally defined pm object in either file

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