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
230
0
Share
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
110
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
200
The future of JavaScript
khaosdoctor
0
66
É hora de falar sobre Deno
khaosdoctor
0
83
JS Software testing for beginners
khaosdoctor
0
95
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
48
The Dark Side of JavaScript
khaosdoctor
0
84
Integrating Containers Into JavaScript
khaosdoctor
0
75
Entendendo o ecossistema de containers
khaosdoctor
1
1k
Other Decks in Technology
See All in Technology
GitHub Advanced Security × Defender for Cloudで開発とSecOpsのサイロを超える: コードとクラウドをつなぐ、開発プラットフォームのセキュリティ
yuriemori
1
120
スクラムを支える内部品質の話
iij_pr
0
110
Datadog で実現するセキュリティ対策 ~オブザーバビリティとセキュリティを 一緒にやると何がいいのか~
a2ush
0
180
JAWS DAYS 2026でAIの「もやっと」感が解消された話
smt7174
1
120
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
3
330
MIX AUDIO EN BROADCAST
ralpherick
0
140
Why we keep our community?
kawaguti
PRO
0
360
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
170
Navigation APIと見るSvelteKitのWeb標準志向
yamanoku
2
140
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
190
不確実性と戦いながら見積もりを作成するプロセス/mitsumori-process
hirodragon112
1
170
AWSで2番目にリリースされたサービスについてお話しします(諸説あります)
yama3133
0
100
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
80
What's in a price? How to price your products and services
michaelherold
247
13k
Marketing to machines
jonoalderson
1
5.1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Everyday Curiosity
cassininazir
0
180
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
96
HDC tutorial
michielstock
1
590
sira's awesome portfolio website redesign presentation
elsirapls
0
200
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
110
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
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