Skip to content

tsconfig.json extending from base tsconfig.json cannot override "declaration" to false #17357

@benny-medflyt

Description

@benny-medflyt

TypeScript Version: 2.4.1

If we have a "base" tsconfig.json file:

{
    "compilerOptions": {
        "declaration": true,
        "declarationDir": "./dist/types"
    }
}

And we try to create another tsconfig.json that extends it:

{
    "extends": "../base/tsconfig.json",
    "compilerOptions": {
        "declaration": false
    }
}

Then it doesn't work. We get error:

error TS5052: Option 'declarationDir' cannot be specified without specifying option 'declaration'.

There doesn't appear to be a way to "unset" the "declarationDir" setting. (Tried null, empty string, undefined)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions