Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
210
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
98
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
60
É hora de falar sobre Deno
khaosdoctor
0
76
JS Software testing for beginners
khaosdoctor
0
82
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
42
The Dark Side of JavaScript
khaosdoctor
0
78
Integrating Containers Into JavaScript
khaosdoctor
0
70
Entendendo o ecossistema de containers
khaosdoctor
1
980
Other Decks in Technology
See All in Technology
生成AI活用の型ハンズオン〜顧客課題起点で設計する7つのステップ
yushin_n
0
260
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
230
障害対応訓練、その前に
coconala_engineer
0
140
Jakarta Agentic AI Specification - Status and Future
reza_rahman
0
120
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
300
日本Rubyの会: これまでとこれから
snoozer05
PRO
4
200
半年で、AIゼロ知識から AI中心開発組織の変革担当に至るまで
rfdnxbro
0
100
ウェルネス SaaS × AI、1,000万ユーザーを支える 業界特化 AI プロダクト開発への道のり
hacomono
PRO
0
270
コンテキスト情報を活用し個社最適化されたAI Agentを実現する4つのポイント
kworkdev
PRO
1
1.7k
打 造 A I 驅 動 的 G i t H u b ⾃ 動 化 ⼯ 作 流 程
appleboy
0
370
AI駆動開発における設計思想 認知負荷を下げるフロントエンドアーキテクチャ/ 20251211 Teppei Hanai
shift_evolve
PRO
2
440
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
1.5k
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
0
940
Navigating Weather and Climate Data
rabernat
0
44
The Spectacular Lies of Maps
axbom
PRO
1
390
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
1.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
57
37k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.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