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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
93
É hora de falar sobre Deno
khaosdoctor
0
90
JS Software testing for beginners
khaosdoctor
0
100
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
62
The Dark Side of JavaScript
khaosdoctor
0
93
Integrating Containers Into JavaScript
khaosdoctor
0
86
Entendendo o ecossistema de containers
khaosdoctor
1
1.1k
Other Decks in Technology
See All in Technology
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
270
WebGIS AI Agentの紹介
_shimizu
0
560
5分でわかるDuckDB Quack
chanyou0311
3
250
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
170
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
270
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
130
AI時代に求められる技術力 フロンティア・クリエイティビティ / Technical Excellence in the AI Era: Frontier Creativity
kaonavi
0
100
AIが自律的に回る開発ループを設計してチーム開発に組み込む
nekorush14
0
130
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
240
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
7.5k
AIに障害切り分けを全部やってもらった。 。 。 。
estie
0
150
GitHub Copilot app最速の発信の裏側
tomokusaba
1
260
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
360
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
How to build a perfect <img>
jonoalderson
1
5.7k
Balancing Empowerment & Direction
lara
6
1.2k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Making Projects Easy
brettharned
120
6.7k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
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