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
180
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
85
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
56
É hora de falar sobre Deno
khaosdoctor
0
68
JS Software testing for beginners
khaosdoctor
0
70
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
71
Integrating Containers Into JavaScript
khaosdoctor
0
60
Entendendo o ecossistema de containers
khaosdoctor
1
910
Other Decks in Technology
See All in Technology
mnt_data_とは?ChatGPTコード実行環境を深堀りしてみた
icck
0
210
やさしいClaude Code入門
minorun365
PRO
32
25k
大事なのは、AIの精度だけじゃない!〜1円のズレも許されない経理領域とAI〜
jun_nemoto
11
5.2k
Java で学ぶ 代数的データ型
ysknsid25
1
530
OTel meets Wasm: プラグイン機構としてのWebAssemblyから見る次世代のObservability
lycorptech_jp
PRO
1
300
Redmineの意外と知らない便利機能 (Redmine 6.0対応版)
vividtone
0
1.2k
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
160
CSS polyfill とその未来
ken7253
0
140
MCP で繋ぐ Figma とデザインシステム〜LLM を使った UI 実装のリアル〜
kimuson
2
1.3k
libsyncrpcってなに?
uhyo
0
160
Scale Security Programs with Scorecarding
ramimac
0
440
S3 Tables を図解でやさしくおさらい~基本から QuickSight 連携まで/s3-tables-illustrated-basics-quicksight
emiki
2
340
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Docker and Python
trallard
44
3.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
460
Thoughts on Productivity
jonyablonski
69
4.7k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Bash Introduction
62gerente
614
210k
Building Applications with DynamoDB
mza
95
6.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Done Done
chrislema
184
16k
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