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
170
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
85
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
180
The future of JavaScript
khaosdoctor
0
55
É hora de falar sobre Deno
khaosdoctor
0
67
JS Software testing for beginners
khaosdoctor
0
68
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
38
The Dark Side of JavaScript
khaosdoctor
0
71
Integrating Containers Into JavaScript
khaosdoctor
0
60
Entendendo o ecossistema de containers
khaosdoctor
1
900
Other Decks in Technology
See All in Technology
MCPが変えるAIとの協働
knishioka
1
130
ペアーズにおける評価ドリブンな AI Agent 開発のご紹介
fukubaka0825
9
2.3k
AIと共に乗り越える、 入社後2ヶ月の苦労と学習の軌跡
sai_kaneko
1
200
Как мы автоматизировали интеграционное тестирование с Gonkey и не пожалели. Паша Егорычев, Кирилл Поляков
lamodatech
0
1.9k
クラウドネイティブ環境の脅威モデリング
kyohmizu
1
350
Асинхронная коммуникация в Go: от понятного к душному. Дима Некрасов, Otello, 2ГИС
lamodatech
0
1.9k
Oracle Cloud Infrastructure:2025年4月度サービス・アップデート
oracle4engineer
PRO
0
360
製造業向けIoTソリューション提案資料.pdf
haruki_uiru
0
180
2025-04-14 Data & Analytics 井戸端会議 Multi tenant log platform with Iceberg
kamijin_fanta
1
180
250510 StepFunctionのテスト自動化始めました vol.1
east_takumi
1
140
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
5.5k
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
4
910
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
830
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
120
52k
The Invisible Side of Design
smashingmag
299
50k
Into the Great Unknown - MozCon
thekraken
38
1.7k
Practical Orchestrator
shlominoach
187
11k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
For a Future-Friendly Web
brad_frost
177
9.7k
The Cost Of JavaScript in 2023
addyosmani
49
7.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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