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
240
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
120
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
210
The future of JavaScript
khaosdoctor
0
88
É hora de falar sobre Deno
khaosdoctor
0
89
JS Software testing for beginners
khaosdoctor
0
99
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
57
The Dark Side of JavaScript
khaosdoctor
0
92
Integrating Containers Into JavaScript
khaosdoctor
0
85
Entendendo o ecossistema de containers
khaosdoctor
1
1.1k
Other Decks in Technology
See All in Technology
はじめてのDatadog
kairim0
0
230
インフラが苦手でも大丈夫! 紙芝居 Kubernetes -WWGT 10周年編-
aoi1
1
310
組織の中で自分を経営する技術
shoota
0
230
大規模災害時でも高い信頼性を維持するアプリケーション基盤の実現/nikkei-tech-talk46
nikkei_engineer_recruiting
0
120
シンデレラなんかになりたくない!ガラスの靴が割れた時代にどう歩く?
nomizone
0
220
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
370
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
120
類似画像検索モデルの開発ノウハウ
lycorptech_jp
PRO
4
1k
自称宇宙最速で不合格となったAIP-C01にリベンジを果たすべくAIで問題集アプリを作ってみた。
yama3133
0
240
oracle-to-databricks-migration-with-llm-and-dbt
casek
1
380
Javaで学ぶSOLID原則
negima
1
240
Agentic Design Patterns
glaforge
0
290
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
Balancing Empowerment & Direction
lara
6
1.1k
Visualization
eitanlees
152
17k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
370
Code Review Best Practice
trishagee
74
20k
Design in an AI World
tapps
1
220
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
130
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
74k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
580
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