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
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScript tips that could save your life
Lucas Santos
May 11, 2023
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
120
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
220
The future of JavaScript
khaosdoctor
0
96
É hora de falar sobre Deno
khaosdoctor
0
93
JS Software testing for beginners
khaosdoctor
0
100
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
69
The Dark Side of JavaScript
khaosdoctor
0
97
Integrating Containers Into JavaScript
khaosdoctor
0
86
Entendendo o ecossistema de containers
khaosdoctor
1
1.1k
Other Decks in Technology
See All in Technology
Genie Codeハンズオン基礎編
taka_aki
1
100
モダンフロントエンド 開発研修
recruitengineers
PRO
4
590
【CEDEC2026】『Relink』を拡張せよ - 『GRANBLUE FANTASY: Relink - Endless Ragnarok』の開発速度と品質を守るCI運用
cygames
PRO
0
150
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
110
JavaScript 研修 (2026)
recruitengineers
PRO
2
500
QAエンジニア起点で進める、SmartHRにおける信頼性向上について
kaomi_wombat
1
130
第3回しろおびセキュリティスポンサーセッション
log0417
0
160
MIRU 2026 チュートリアル
keisuke198619
0
880
PLATEAU で バーチャル花火大会
tatsuya1970
0
140
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
790
個人OSSが、机の上から世界に広がるまでの話
shinyasaita
1
380
私がブラウザを自作したくなった理由
supurazako
0
110
Featured
See All Featured
Between Models and Reality
mayunak
4
390
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
460
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Making Projects Easy
brettharned
120
6.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
470
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
KATA
mclloyd
PRO
35
15k
Facilitating Awesome Meetings
lara
57
7.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