Dan Vanderkam 🦋

1.3K posts

Dan Vanderkam 🦋

Dan Vanderkam 🦋

@danvdk

Independent software developer, formerly @sidewalklabs and Google. Author of Effective TypeScript, now in its 2nd edition (May 2024): https://t.co/NV5HD4jX8C

Hudson Valley, NY Katılım Şubat 2009
121 Takip Edilen3.1K Takipçiler
Sabitlenmiş Tweet
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
It's here! 🎉 The 2nd edition of Effective TypeScript is now available in all formats. The bird on the cover is the same, but the content is throughly revised and expanded to reflect how TS is used in 2024. Get your copy today! @OReillyMedia amzn.to/3UjPrsK
Dan Vanderkam 🦋 tweet media
English
8
25
181
12.2K
Dan Vanderkam 🦋 retweetledi
Nadim
Nadim@0xNadim1·
writing typescript for the first time in 6 years, and i think im enjoying it? new additions like type predicates inference make for a much nicer devex found a very cool article too documenting the development process of this feature from @danvdk effectivetypescript.com/2024/04/16/inf…
English
1
1
8
566
Mateusz Burzyński
Mateusz Burzyński@AndaristRake·
I still find surprising type behaviors in TypeScript. This one makes sense but I had to think about it for a moment to understand how it can be explained: #code/GYVwdgxgLglg9mABMMAKAlIg3gKEYgGwFMpEBnKEYYAbj0RmEVQFkBDKACwDoAnNsABM4AWwyZc+fBSpMAvIgBEwOHEV18AX0RECZItnrTK1RAoAsAJhqIA9LcRwA1vU30ZphYoBGbXupw3HAgCNjIyRABhPUNjWTp6CAQKXhBoOF4MWKlGZnYuPgFhMXQJIykuGDJuD3klFTUNKW1dfWypRErq2rNEKxt7HV5eDPKgjq6akzqfPwCtQJwgA" target="_blank" rel="nofollow noopener">typescriptlang.org/play/?ts=5.7.0…
English
2
1
14
4.2K
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
Just published a big update to my "X-Ray Glasses for any types" VS Code extension: marketplace.visualstudio.com/items?itemName… It uses the built-in TypeScript server now, which makes it faster and more likely to work with your project. Give it a try! It found some anys in vscode and tsc itself!
Dan Vanderkam 🦋 tweet media
English
0
0
24
1.7K
Dan Vanderkam 🦋 retweetledi
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
For a weekend project, I wrote a VS Code extension: X-Ray Vision for any types. The scary thing about "any" is that it can appear in surprising place and silently spread. No more! This was frustrating, rewarding, and hopefully useful. Give it a try! marketplace.visualstudio.com/items?itemName…
Dan Vanderkam 🦋 tweet media
English
11
14
206
24.6K
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
@jjalan There are always unexpected any types that come from @types packages. For example, #L135" target="_blank" rel="nofollow noopener">github.com/DefinitelyType… or #L449" target="_blank" rel="nofollow noopener">github.com/DefinitelyType…
English
0
0
2
246
Jai Jalan
Jai Jalan@jjalan·
@danvdk Love it. Curious, have you run into any unexpected patterns while testing it?
English
1
0
2
260
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
@deanylev Thanks, I’ll take a look. It’s almost certainly not finding the lib.d.ts files for your project, so it can’t get types for callbacks like forEach.
English
1
0
1
70
Ashley Claymore
Ashley Claymore@acutmore·
@danvdk @JoshuaKGoldberg I suspect you're already aware and this wouldn't work but just in case there is this: #L10" target="_blank" rel="nofollow noopener">github.com/orta/vscode-tw… Command for getting type info from the existing tsserver.
English
1
0
4
359
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
@stevebeauge unknown is much safer than any, since you’ll get a type error if you try to do much of anything with it.
English
0
0
0
99
Steve B
Steve B@stevebeauge·
@danvdk would it make sense to also detect unknowns ? I've some weird bugs when using zod's passthrought, and "seeing" unknown may prevent it.
English
1
0
1
210
Dan Vanderkam 🦋
Dan Vanderkam 🦋@danvdk·
@deanylev Can you share your project? There’s a real diversity in how everyone has TS configured, I’m not surprised it’s failing on some setups.
English
1
0
1
161
Dean Levinson
Dean Levinson@deanylev·
@danvdk Hmm it seems to randomly highlight a bunch of non-any vars for me in my Bun + ElysiaJS project, while not highlighting an actually any var :/
English
1
0
1
183