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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
94
É 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
95
Integrating Containers Into JavaScript
khaosdoctor
0
86
Entendendo o ecossistema de containers
khaosdoctor
1
1.1k
Other Decks in Technology
See All in Technology
AI時代の強いチームの作り方
yuukiyo
25
16k
ラジオの科学
frievea
0
240
SnowflakeCoCoでデータエンジニアリング!
foursue
0
180
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
760
NetBoxを利用した作業効率化の試み_NetDevNight4
tnoha
0
470
もう一度考える SRE チームの作り方・育て方 / Rethinking SRE #1: Building and Growing SRE Teams
rrreeeyyy
6
990
変化の早いClaude Codeを 書籍に落とし込む
oikon48
6
1.3k
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
0
160
サイバー捜査員研修(後半)
nomizone
1
740
オートロックマンションなのに、各部屋は施錠なし!? 攻撃者が組織内ネットワークで大暴れする理由 / The Front Door Is Locked, but the Rooms Are Wide Open: Why Attackers Move Freely Inside Enterprise Networks
nttcom
1
1.5k
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
180
plamo-3-translateの開発
pfn
PRO
0
280
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
750
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
How to make the Groovebox
asonas
2
2.3k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Designing for Timeless Needs
cassininazir
1
430
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Paper Plane
katiecoart
PRO
2
52k
BBQ
matthewcrist
89
10k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
360
The World Runs on Bad Software
bkeepers
PRO
72
12k
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