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
85
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
69
JS Software testing for beginners
khaosdoctor
0
70
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
現場で役立つAPIデザイン
nagix
1
180
Text-to-SQLの評価データセットを作って最新LLMモデルの性能評価をしてみた
gotalab555
2
390
実践Kafka Streams 〜イベント駆動型アーキテクチャを添えて〜
joker1007
3
820
うちの会社の評判は?SNSの投稿分析にAIを使ってみた
doumae
0
610
AI Engineering Summit Pre Event LT #10
okaru
2
280
組織とセキュリティ文化と、自分の一歩
maimyyym
3
1.4k
医療業界に特化した音声認識モデル構築のためのアノテーションの実態
thickstem
0
460
Introduction to Bill One Development Engineer
sansan33
PRO
0
240
Applied NLP in the Age of Generative AI: Future-Proof Strategies for Banking and Finance
inesmontani
PRO
0
210
kintone開発組織のDevOpsへの移り変わりと実践
ueokande
1
270
Vibe Codingの裏で、 考える力をどう取り戻すか
csekine
0
330
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
2k
Featured
See All Featured
Six Lessons from altMBA
skipperchong
28
3.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
1
100
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
We Have a Design System, Now What?
morganepeng
52
7.6k
KATA
mclloyd
29
14k
RailsConf 2023
tenderlove
30
1.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
How GitHub (no longer) Works
holman
314
140k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Adopting Sorbet at Scale
ufuk
76
9.4k
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