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
230
0
Share
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
110
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
200
The future of JavaScript
khaosdoctor
0
71
É hora de falar sobre Deno
khaosdoctor
0
84
JS Software testing for beginners
khaosdoctor
0
97
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
50
The Dark Side of JavaScript
khaosdoctor
0
86
Integrating Containers Into JavaScript
khaosdoctor
0
78
Entendendo o ecossistema de containers
khaosdoctor
1
1k
Other Decks in Technology
See All in Technology
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
1.7k
Databricksで構築するログ検索基盤とアーキテクチャ設計
cscengineer
0
170
JEDAI in Osaka 2026イントロ
taka_aki
0
160
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
23k
Digitization部 紹介資料
sansan33
PRO
1
7.2k
Introduction to Bill One Development Engineer
sansan33
PRO
0
410
【PHPカンファレンス小田原2026】Webアプリケーションエンジニアにも知ってほしい オブザーバビリティ の本質
fendo181
0
600
Discordでリモートポケカしてたら、なぜかDOを25分間動かせるようになった話
umireon
0
130
GitHub Copilotを極める会 - 開発者のための活用術
findy_eventslides
7
4.1k
え!?初参加で 300冊以上 も頒布!? これは大成功!そのはずなのに わいの財布は 赤字 の件
hellohazime
0
140
こんなアーキテクチャ図はいやだ / Anti-pattern in AWS Architecture Diagrams
naospon
1
250
仕様通り動くの先へ。Claude Codeで「使える」を検証する
gotalab555
9
3.3k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Designing Experiences People Love
moore
143
24k
Designing for Performance
lara
611
70k
Site-Speed That Sticks
csswizardry
13
1.1k
The Pragmatic Product Professional
lauravandoore
37
7.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
How to make the Groovebox
asonas
2
2.1k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
500
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
160
Prompt Engineering for Job Search
mfonobong
0
260
HDC tutorial
michielstock
1
610
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