Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TypeScript tips that could save your life
Search
Lucas Santos
May 11, 2023
Technology
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScript tips that could save your life
Lucas Santos
May 11, 2023
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
120
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
220
The future of JavaScript
khaosdoctor
0
96
É hora de falar sobre Deno
khaosdoctor
0
93
JS Software testing for beginners
khaosdoctor
0
100
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
69
The Dark Side of JavaScript
khaosdoctor
0
97
Integrating Containers Into JavaScript
khaosdoctor
0
86
Entendendo o ecossistema de containers
khaosdoctor
1
1.1k
Other Decks in Technology
See All in Technology
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
300
ガバメントクラウドでのランサムウェア対策
techniczna
2
1k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
8
2.2k
Cursor Meetup Sapporo - Cursor物語 続編
cocacola917
0
140
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
230
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
1
370
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
780
強化学習「理論」入門
enakai00
3
3.6k
え?フロントエンドエンジニアの ワイがインフラも!?
puku0x
1
450
第3回しろおびセキュリティスポンサーセッション
log0417
0
160
名古屋の市バスGTFS-JPデータ×スガキヤ 最寄りバス停検索をAmazon ElastiCache Serverless for Valkeyで最適化する
usanchuu
1
510
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
200
How GitHub (no longer) Works
holman
316
150k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
240
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
Test your architecture with Archunit
thirion
1
2.3k
Speed Design
sergeychernyshev
33
2k
BBQ
matthewcrist
89
10k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
290
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
350
The Mindset for Success: Future Career Progression
greggifford
PRO
0
440
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
TypeScript tips that could save your life
who am I_ {twitter, youtube, linkedin…}.lsantos.dev software engineer_
[email protected]
typescript can be tricky sometimes
so let's cut to the chase_
tsconfig extension_
None
None
None
None
None
It's not only for bases
It's not only for bases
type_ testing
one native way: *.typetest.ts files
one native way: *.typetest.ts files https://lsantos.dev/keychain-pull
the (more) native way
vitest
tsd https://lsantos.dev/tsd-lib
move errors to types
instead of this
do this
branded types_
UUIDs are the perfect example
to brand a type
to brand a type
even better
but well… Why isn't this working
but well… Why isn't this working To be continued…
but there's another example
type guards_
but well… Why isn't this working
now we have something
but this if…
assertion functions
assertion out of tests
understand your enums_
enums produce valid JavaScript
enums produce valid JavaScript
numeric enums
string enums
constant enums
constant enums
obrigado_ lsantos.dev