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
0
200
TypeScript tips that could save your life
Lucas Santos
May 11, 2023
Tweet
Share
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
88
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
58
É hora de falar sobre Deno
khaosdoctor
0
73
JS Software testing for beginners
khaosdoctor
0
74
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
40
The Dark Side of JavaScript
khaosdoctor
0
73
Integrating Containers Into JavaScript
khaosdoctor
0
64
Entendendo o ecossistema de containers
khaosdoctor
1
960
Other Decks in Technology
See All in Technology
ブラウザのAPIで Nintendo Switch用の特殊なゲーム用コントローラーを体験型コンテンツに / IoTLT @ストラタシス・ジャパン
you
PRO
0
110
入院医療費算定業務をAIで支援する:包括医療費支払い制度とDPCコーディング (公開版)
hagino3000
0
110
個人でデジタル庁の デザインシステムをVue.jsで 作っている話
nishiharatsubasa
3
5k
AI時代におけるデータの重要性 ~データマネジメントの第一歩~
ryoichi_ota
0
710
Introdução a Service Mesh usando o Istio
aeciopires
1
280
現場の壁を乗り越えて、 「計装注入」が拓く オブザーバビリティ / Beyond the Field Barriers: Instrumentation Injection and the Future of Observability
aoto
PRO
1
380
AI AgentをLangflowでサクッと作って、1日働かせてみた!
yano13
1
150
SCONE - 動画配信の帯域を最適化する新プロトコル
kazuho
1
370
OCIjp_Oracle AI World_Recap
shinpy
1
180
AI時代、“平均値”ではいられない
uhyo
8
2.5k
Zephyr(RTOS)にEdge AIを組み込んでみた話
iotengineer22
1
340
マルチエージェントのチームビルディング_2025-10-25
shinoyamada
0
150
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
The World Runs on Bad Software
bkeepers
PRO
72
11k
A better future with KSS
kneath
239
18k
Visualization
eitanlees
149
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Typedesign – Prime Four
hannesfritz
42
2.8k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
610
What's in a price? How to price your products and services
michaelherold
246
12k
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