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
190
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
88
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
57
É hora de falar sobre Deno
khaosdoctor
0
72
JS Software testing for beginners
khaosdoctor
0
74
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
72
Integrating Containers Into JavaScript
khaosdoctor
0
63
Entendendo o ecossistema de containers
khaosdoctor
1
930
Other Decks in Technology
See All in Technology
LLMでAI-OCR、実際どうなの? / llm_ai_ocr_layerx_bet_ai_day_lt
sbrf248
0
430
Claude Codeから我々が学ぶべきこと
s4yuba
10
2.5k
GMOペパボのデータ基盤とデータ活用の現在地 / Current State of GMO Pepabo's Data Infrastructure and Data Utilization
zaimy
3
210
【新卒研修資料】数理最適化 / Mathematical Optimization
brainpadpr
25
12k
AWS re:Inforce 2025 re:Cap Update Pickup & AWS Control Tower の運用における考慮ポイント
htan
1
210
Google Agentspaceを実際に導入した効果と今後の展望
mixi_engineers
PRO
3
340
2025新卒研修・HTML/CSS #弁護士ドットコム
bengo4com
3
13k
Claude Codeは仕様駆動の夢を見ない
gotalab555
22
5k
KubeCon + CloudNativeCon Japan 2025 Recap
donkomura
0
180
解消したはずが…技術と人間のエラーが交錯する恐怖体験
lamaglama39
0
190
AIに頼りすぎない新人育成術
cuebic9bic
3
180
LTに影響を受けてテンプレリポジトリを作った話
hol1kgmg
0
320
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.4k
BBQ
matthewcrist
89
9.8k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Fireside Chat
paigeccino
38
3.6k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.5k
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