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
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
100
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
77
JS Software testing for beginners
khaosdoctor
0
85
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
42
The Dark Side of JavaScript
khaosdoctor
0
79
Integrating Containers Into JavaScript
khaosdoctor
0
70
Entendendo o ecossistema de containers
khaosdoctor
1
990
Other Decks in Technology
See All in Technology
Next.js 16の新機能 Cache Components について
sutetotanuki
0
210
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
5
12k
あの夜、私たちは「人間」に戻った。 ── 災害ユートピア、贈与、そしてアジャイルの再構築 / 20260108 Hiromitsu Akiba
shift_evolve
PRO
0
190
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
170
さくらのクラウド開発ふりかえり2025
kazeburo
2
1.3k
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
280
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
540
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
1.2k
Everything As Code
yosuke_ai
0
460
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
310
技術選定、下から見るか?横から見るか?
masakiokuda
0
170
Qiita Bash アドカレ LT #1
okaru
0
100
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
Are puppies a ranking factor?
jonoalderson
0
2.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
A better future with KSS
kneath
240
18k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
100
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Unsuck your backbone
ammeep
671
58k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Bash Introduction
62gerente
615
210k
How to Ace a Technical Interview
jacobian
281
24k
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