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
220
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
100
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
61
É hora de falar sobre Deno
khaosdoctor
0
77
JS Software testing for beginners
khaosdoctor
0
87
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
42
The Dark Side of JavaScript
khaosdoctor
0
81
Integrating Containers Into JavaScript
khaosdoctor
0
70
Entendendo o ecossistema de containers
khaosdoctor
1
1k
Other Decks in Technology
See All in Technology
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.8k
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
140
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
270
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
480
What happened to RubyGems and what can we learn?
mikemcquaid
0
310
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.4k
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
610
Greatest Disaster Hits in Web Performance
guaca
0
280
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
140
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
450
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
630
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Building an army of robots
kneath
306
46k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
エンジニアに許された特別な時間の終わり
watany
106
230k
We Have a Design System, Now What?
morganepeng
54
8k
The Invisible Side of Design
smashingmag
302
51k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
69
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
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