microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.63k stars 12.44k forks source link

Remove Unnecessary lib.*.d.ts Entries #24058

Open SlurpTheo opened 6 years ago

SlurpTheo commented 6 years ago

Why in lib.es6.d.ts do these exist:

interface String {
    /** Returns a string representation of a string. */
    toString(): string;
}

interface Symbol {
    /** Returns a string representation of an object. */
    toString(): string;
}

Where this does not:

interface Boolean {
    /** Returns a string representation of a boolean. */
    toString(): string;
}

Cleanup redundant (inherited from Object) entries like toString(): string on some interfaces.

RE: https://github.com/Microsoft/TypeScript/pull/23721#issuecomment-388128341

mhegazy commented 6 years ago

PRs welcomed.

thejohnfreeman commented 5 years ago

Should this be closed? The file now has no declarations of its own.

SlurpTheo commented 5 years ago

Should this be closed? The file now has no declarations of its own.

So, lib.es6.d.ts doesn't have them anymore, but it "ninjas" back to using lib.es5.d.ts which still contains:

interface String {
    /** Returns a string representation of a string. */
    toString(): string;
}

interface Symbol {
    /** Returns a string representation of an object. */
    toString(): string;
}
SlurpTheo commented 5 years ago

When you remove these "needless" entries, you don't get .toString() showing up in IntelliSense (like is the case today on a boolean in VSCode@1.39.0)