You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support using the target + lib options to resolve d.ts per playground session #7
I was trying to help someone with a problem using Object.entries but the playground didn't think it existed. The options panel is great, but doesn't offer a way to specify the lib option. This is a fairly troublesome issue when trying to help people with their modern, up-to-date code.
Perhaps a short-term easy fix would be to default to the latest libs?
Eventually, being able to specify libs (or even a full tsconfig.json as suggested in #4) would probably be best.
changed the title [-]Add support for lib options to the playground[/-][+]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/+]on Mar 23, 2020
That's what this issue is about - I shipped a deploy change which makes the nightly builds use the ESNext build last week, so you can test out what it will be like for 4.0 here: https://www.staging-typescript.org/play?ts=next
changed the title [-]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/-][+]Support using the target + lib options to resolve d.ts per playground session[/+]on Jun 25, 2020
Activity
orta commentedon Jul 11, 2019
I've added the extra paragraph from your original post 👍
orta commentedon Mar 23, 2020
This got update to ES2015 - so for now I'll close it
orta commentedon Mar 23, 2020
I've been using this as the catch-all for grabbing the right lib files for the TS Playground - so we'll keep it here
[-]Add support for lib options to the playground[/-][+]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/+]apieceofbart commentedon Jun 15, 2020
What about stuff like
Array.prototype.includes?orta commentedon Jun 15, 2020
That's what this issue is about - I shipped a deploy change which makes the nightly builds use the ESNext build last week, so you can test out what it will be like for 4.0 here: https://www.staging-typescript.org/play?ts=next
apieceofbart commentedon Jun 15, 2020
Orta Therox (@orta) wow, this looks awesome! thanks a lot!
[-]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/-][+]Support using the target + lib options to resolve d.ts per playground session[/+]orta commentedon Jun 26, 2020
microsoft/monaco-typescript#64 - will unblock this feature
iugo commentedon Jan 30, 2021
use
Object.fromEntries()setting: "lib": ["ES2019"]
orta commentedon Mar 10, 2021
This is in
adaamz commentedon Mar 29, 2021
Orta Therox (@orta) I don't see the
liboption in TSConfig options tab, was this added or what is the resolution for this issue?orta commentedon Mar 29, 2021
You can use twoslash notation to define your own lib:
// @lib: ["thing", "other"]- I'm not sure if I'll ever give it a UImajellin24 commentedon Feb 8, 2022
For anyone arriving here looking for how to enable this like me, I was not able to use the notation mentioned above like:
// @lib: ["thing", "other"]I tried several variations and other settings changed before bothering to look into some of the other tickets in which this was mentioned.
To potentially save someone a few minutes, the way I was able to get it to work was the following: