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
72
JS Software testing for beginners
khaosdoctor
0
74
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
73
Integrating Containers Into JavaScript
khaosdoctor
0
64
Entendendo o ecossistema de containers
khaosdoctor
1
950
Other Decks in Technology
See All in Technology
AI ReadyなData PlatformとしてのAutonomous Databaseアップデート
oracle4engineer
PRO
0
140
BirdCLEF+2025 Noir 5位解法紹介
myso
0
190
Modern_Data_Stack最新動向クイズ_買収_AI_激動の2025年_.pdf
sagara
0
190
履歴 on Rails: Bitemporal Data Modelで実現する履歴管理/history-on-rails-with-bitemporal-data-model
hypermkt
0
2k
GA technologiesでのAI-Readyの取り組み@DataOps Night
yuto16
0
260
Geospatialの世界最前線を探る [2025年版]
dayjournal
3
470
GC25 Recap+: Advancing Go Garbage Collection with Green Tea
logica0419
1
360
Flaky Testへの現実解をGoのプロポーザルから考える | Go Conference 2025
upamune
1
390
動画データのポテンシャルを引き出す! Databricks と AI活用への奮闘記(現在進行形)
databricksjapan
0
130
Optuna DashboardにおけるPLaMo2連携機能の紹介 / PFN LLM セミナー
pfn
PRO
1
830
「AI駆動PO」を考えてみる - 作る速さから価値のスループットへ:検査・適応で未来を開発 / AI-driven product owner. scrummat2025
yosuke_nagai
2
500
OpenAI gpt-oss ファインチューニング入門
kmotohas
2
860
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Raft: Consensus for Rubyists
vanstee
139
7.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
19
1.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Optimizing for Happiness
mojombo
379
70k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Designing for Performance
lara
610
69k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Into the Great Unknown - MozCon
thekraken
40
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