Let's just turn on everything. Something like ['dom', 'dom.iterable', 'esnext']?
As long as that doesn't confuse people about what browser APIs are actually available in their target browsers. You could also set target to es6 and it would infer some reasonable libs for you (but again APIs would probably break in IE11)
We keep getting issues of people confused why TypeScript is telling them about valid errors. 馃槄
I figure if people know about lib and how it works, they'll know to switch it to what they actually want.
That's why I'm OK with an everything-evergreen-on-by-default behavior.
Yeah good call. I actually ran into an obscure error reported because of it yesterday when porting to react-scripts since I was using async / await. It complained about Promise not being available but the formatting was really strange.
May want to double check what's included in esnext lib, because i think it includes stage 0 proposals?
Eh, they're just browser APIs I don't think it's a big deal.
Thanks for this! It would be really awesome if this could be released in a new create-react-app version, because I just spent a really long time trying to figure out why I was getting type errors with Array.includes, etc. It would have been awesome if my default tsconfig.json had these libs by default. But oh well, it was a great way to learn how it all works.
What's the process for including these changes in my project? I just put in my own lib line for now but I'd rather this were created/enforced by verifyTypeScriptSetup.js. Do I just wait for the next CRA release and update?
What's the process for including these changes in my project? I just put in my own
libline for now but I'd rather this were created/enforced byverifyTypeScriptSetup.js. Do I just wait for the next CRA release and update?
I think it will be used as default in case if you don't have tsconfig.json file yet. Putting it manually is the right way of doing it, since you might choose to use different lib value for your project, i.e more restrictive one like ["dom", "es6", "es2017.object"]
Most helpful comment
Eh, they're just browser APIs I don't think it's a big deal.