Skip to content

ES6 emit missing some typings with lib.d.ts (ES5 typings) #5504

Closed
@alexeagle

Description

@alexeagle

I need to emit non-downlevel ES6 code to feed into another tool in the toolchain.
However, I want to ensure that the project includes only ES5 library code, because there are no runtime polyfills nor does the 6-to-5 tool do any API conversions.

So, I want simply tsc --target es6 --noLib node_modules/typescript/lib/lib.d.ts app.ts
but this doesn't work:

$ ./node_modules/.bin/tsc
error TS2318: Cannot find global type 'Iterable'.
error TS2318: Cannot find global type 'IterableIterator'.
error TS2318: Cannot find global type 'Iterator'.
error TS2318: Cannot find global type 'Symbol'.
error TS2468: Cannot find global value 'Symbol'.

I've followed #4692 but I wonder if there is another answer for this.

Repro
tsconfig.json

    "compilerOptions": {
        "target": "es6",
        "noLib": true,
        "noImplicitAny": false,
        "outDir": "built",
        "rootDir": ".",
        "sourceMap": false
    },
    "exclude": [
        "node_modules"
    ],
    "files": [
        "app.ts",
        "node_modules/typescript/lib/lib.d.ts"
    ]
}

app.ts

let a: string = "hello";

Metadata

Metadata

Assignees

No one assigned

    Labels

    @typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions