pulumi / templates

Templates used by `pulumi new`
Apache License 2.0
100 stars 66 forks source link

Update TS templates to target `es2018` #116

Open justinvp opened 4 years ago

justinvp commented 4 years ago

Node 10+ has broad support for ES2018 -- we should update the TS templates to target it.

justinvp commented 4 years ago

We should also look at updating the built-in default settings for when a project doesn't have a tsconfig.json present:

justinvp commented 4 years ago

We should also do a pass of the docs to ensure any tsconfig snippets are updated and consistent.

justinvp commented 4 years ago

As part of this, we should consider explicitly setting lib as follows:

"lib": ["es2018"],

Otherwise, the default library used by TS when target is set to 2018 is es2018.full, which includes a bunch of stuff like dom, webworkers, etc. which isn't relevant outside the browser.

https://github.com/microsoft/TypeScript/blob/master/lib/lib.es2018.full.d.ts vs https://github.com/microsoft/TypeScript/blob/master/lib/lib.es2018.d.ts

justinvp commented 3 years ago

Pulumi 3.x supports Node 12+. We should look into using https://github.com/tsconfig/bases/blob/main/bases/node12.json as the basis for the tsconfig.json in templates.