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
180
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
87
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
56
É hora de falar sobre Deno
khaosdoctor
0
72
JS Software testing for beginners
khaosdoctor
0
73
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
72
Integrating Containers Into JavaScript
khaosdoctor
0
63
Entendendo o ecossistema de containers
khaosdoctor
1
920
Other Decks in Technology
See All in Technology
KubeCon + CloudNativeCon Japan 2025 Recap Opening & Choose Your Own Adventureシリーズまとめ
mmmatsuda
0
280
関数型プログラミングで 「脳がバグる」を乗り越える
manabeai
1
190
敢えて生成AIを使わないマネジメント業務
kzkmaeda
2
450
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
6
2.4k
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
9.4k
Reach American Airlines®️ Instantly: 19 Calling Methods for Fast Support in the USA
flyamerican
1
170
20250707-AI活用の個人差を埋めるチームづくり
shnjtk
4
3.9k
LangChain Interrupt & LangChain Ambassadors meetingレポート
os1ma
2
320
Sansanのデータプロダクトマネジメントのアプローチ
sansantech
PRO
0
160
Lufthansa ®️ USA Contact Numbers: Complete 2025 Support Guide
lufthanahelpsupport
0
200
AI専用のリンターを作る #yumemi_patch
bengo4com
5
4.3k
Beyond Kaniko: Navigating Unprivileged Container Image Creation
f30
0
130
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building an army of robots
kneath
306
45k
Site-Speed That Sticks
csswizardry
10
690
Mobile First: as difficult as doing things right
swwweet
223
9.7k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Embracing the Ebb and Flow
colly
86
4.7k
Rails Girls Zürich Keynote
gr2m
95
14k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
What's in a price? How to price your products and services
michaelherold
246
12k
Gamification - CAS2011
davidbonilla
81
5.4k
Docker and Python
trallard
44
3.5k
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