microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 102 forks source link

Use "lib" instead of "target" for DefinitelyTyped tsconfig #28

Closed ghost closed 7 years ago

ghost commented 7 years ago

Updating now that DefinitelyTyped/DefinitelyTyped#13968 is in.

winksaville commented 7 years ago

@andy-ms may I ask why its preferred to use lib instead of target? Is there some documentation on when one or the other should be chosen?

ghost commented 7 years ago

Since we're not actually emitting code for these tests there's no need for a target. "lib" gives you more fine-grained control over what libraries get included; a non-web library should not include the "dom" lib.

If you're writing a normal TypeScript project, you don't have to choose between them. You should generally always set "target", and you can set "lib" if either you don't want "dom" typings, or you want to include some lib that isn't on by default.

winksaville commented 7 years ago

Got it, TYVM.