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
86
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
71
Integrating Containers Into JavaScript
khaosdoctor
0
61
Entendendo o ecossistema de containers
khaosdoctor
1
910
Other Decks in Technology
See All in Technology
本部長の代わりに提案書レビュー! KDDI営業が毎日使うAIエージェント「A-BOSS」開発秘話
minorun365
PRO
14
1.7k
Cloud Native Scalability for Internal Developer Platforms
hhiroshell
2
450
(非公式) AWS Summit Japan と 海浜幕張 の歩き方 2025年版
coosuke
PRO
1
230
Agentic DevOps時代の生存戦略
kkamegawa
0
160
Tenstorrent 開発者プログラム
tenstorrent_japan
0
310
AWS全冠したので振りかえってみる
tajimon
0
140
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
開発効率と信頼性を両立する Ubieのプラットフォームエンジニアリング
teru0x1
0
140
Rubyで作る論理回路シミュレータの設計の話 - Kashiwa.rb #12
kozy4324
1
280
ゆるSRE #11 LT
okaru
1
590
白金鉱業Meetup_Vol.19_PoCはデモで語れ!顧客の本音とインサイトを引き出すソリューション構築
brainpadpr
2
320
Amazon Q Developer for GitHubとAmplify Hosting でサクッとデジタル名刺を作ってみた
kmiya84377
0
3.5k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Fireside Chat
paigeccino
37
3.5k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
Gamification - CAS2011
davidbonilla
81
5.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.7k
Rails Girls Zürich Keynote
gr2m
94
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Writing Fast Ruby
sferik
628
61k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Unsuck your backbone
ammeep
671
58k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
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