Skip to content

proposal: add ' min-tsc-version' config on d.ts file and tsconfig.json #10022

@WanderWang

Description

@WanderWang

consider this code :

//some-lib.d.ts
declare function foo():number | undefined
//a.ts
foo();

when somebody use some-lib.d.ts with tsc1.8 , they will got a exception some-lib.d.ts(1,33): error TS2304: Cannot find name 'undefined'. . And they will be confused because they may not know about strict-null features in TypeScript 2.0

So I think we should add a 'min-tsc-version' on d.ts file , for example :

//some-lib.d.ts


/// min-tsc-version : 2.0.0
declare function foo():number | undefined
//tsconfig.json
{
    “compileOption": {
        "min-tsc-version":2.0.0
    }
}

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