Typescript: Do not emit `/// <reference types=".." />` for augmented declarations in dependencies

Created on 26 Oct 2016  路  6Comments  路  Source: microsoft/TypeScript

/// <reference types="node" />
interface I {
    e: Error;
}
> npm install @types/node

> tsc --d a.ts

> type a.ts

/// <reference types="node" />
interface I {
    e: Error;
}

Error should not be cause a type dependency as it partially came from lib.d.ts

Bug

Most helpful comment

@mhegazy oo just go in by hand and remove them from the artifacts, before we publish? A crude but hilariously effective solution.

All 6 comments

RxJS member here, any ideas how we can work around this as a library author, so our users don't have to? (as we wait for 2.1) https://github.com/ReactiveX/rxjs/issues/2112 It looks like we misunderstand what the real problem is--we thought we fixed it in https://github.com/ReactiveX/rxjs/pull/2120 but turns out we didn't.

Since I don't see hundreds of devs yelling in this thread about this, perhaps there is something we're doing we can avoid? We could build RxJS with canary/dev release, but we'd prefer not to for risk of adding _other_ bugs as well.

you can strip out the /// <reference types ... /> from the resulting .d.ts files, wouldn't this be sufficient?

@mhegazy oo just go in by hand and remove them from the artifacts, before we publish? A crude but hilariously effective solution.

you just need a regex.

alternatively 2.1 RC should have the fix for the issue.

Sadly using @jayphelps approach to fixing this bug until next RC ....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgrieder picture bgrieder  路  3Comments

blendsdk picture blendsdk  路  3Comments

kyasbal-1994 picture kyasbal-1994  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments

DanielRosenwasser picture DanielRosenwasser  路  3Comments