The TS Playground has PLUGINS
HTML-код
- Опубликовано: 28 сен 2024
- I've been using the TypeScript playground wrong all this time. These plugins are SO useful and improve my dev life so much, given how much time I spend on the TS playground helping people.
Playground: www.typescript...
Become a TypeScript Wizard with my free beginners TypeScript Course:
www.totaltypes...
Follow Matt on Twitter
/ mattpocockuk
Join the Discord:
mattpocock.com...
The vim plugin was the first one I turned on when I found out about plugins. Didn't know it could do imports! That's a game changer!
Vim is something for me... Normally I copy and paste from my Vim into TS Playground. This unlocks my speed.
Damn! I knew plugins but I didn't know you could import other packages 🤦♂️🤦♂️🤦♂️
I remember asking for help in your discord and sending a codebox link lmao, I didn't know about typescript playground until then, thanks Matt!
Love these bite sized nuggets of useful info!
I like this short format
@Matt How did you configure playground to be able to import external libraries like "zod"? I tried, but such code does not compile.... "Cannot use import statement outside a module"
Wow. Everyday something new.Thanks!
Thanks again Matt!
Hi Matt. I love your channel!
Quick question: how do i create an object implementing an interface, but to type it as object literal as usual with `as const`? I can think of one solution using generics for each property which is to dirty.
const myObj = {} as const satisfies MyInterface
@@mattpocockuk that is exactly what i needed and couldn't find. Thank you!!
:)) youre way too funny and excited
I feel like I was using discord in light mode, how long they had that?
Nice tip
I really missed vim motions
I hate Prettier. But links shortening seems to be very useful.
Hello Matt can you help me?
interface IListItem {
stt: number;
name: string;
}
const list: IListItem[] = [
{
stt: 1,
name: "name1",
},
];
function getKey(items: T[], key: K): T[K][] {
return items.map((item) => item[key]);
}
console.log("««««« keyList »»»»»", getKey(list, "invalid"));
When i use interface here type script throw me errors :
" Argument of type '"invalid"' is not assignable to parameter of type 'keyof IListItem' "
i want typescript throw me error :
" Argument of type '"invalid"' is not assignable to parameter of type '"stt" | "name"'"
Please help me! Thankyou!
Could you ask in my Discord? mattpocock.com/discord
Plugin Baby
Strongly types my enemies
THICC SCRIPT
Say whaaat now?
welp have no idea about ts playground to begin with lol
Hey Matt! Mind to use your magic wand in this video for us? I watched it but didn't quite get it... Please
v=B7ygRIQcQPE
Hi guys. I am using Mac and when i want to check a list of possible values based on my types, using CMD + space doesn't work. Does anyone know how to get a list of possible values ( autosuggestion ) in TS playground ?
I wish the imports worked consistently. Half the time they don't resolve and there's no retry button anywhere either :\
Can't make import work. Anyone else?
i use all editors on crap mode, but that might just be me?
hmm first time even hearing about TS playground! I'll check this out thanks!!
Oh my god. I feel so incredibly dumb today 🤯
All of these are stuff I used to be annoyed that the TS playground didn't have.
Thanks Matt! I saw the plugins tab but had no idea what it really did--having prettier is a game changer!
How Posh... plugins!
Hi, Matt! Your videos are amazing and what you doing sometimes looks like real magic to me =) And when I thought of that, I was interested - maybe you know or maybe can figure out the solution for one thing that bothers me from the time I switched from java to typescript two years ago: method chaining. In TypeScript\JavaScript there is no way to beautifully chain async methods (i mean like this: await someInstance.someAsyncMethod1().someAsyncMethod2().someAsyncMethod3() ... where every method returning 'this') - you should wrap any async method invocation into parenthesis and add await keyword, and that's looking clumsy and barely readable. Through years I found no solution for it. Maybe real TypeScript magician like you can show the way? =)