$30 off During Our Annual Pro Sale. View Details »
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
97
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
75
JS Software testing for beginners
khaosdoctor
0
81
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
42
The Dark Side of JavaScript
khaosdoctor
0
78
Integrating Containers Into JavaScript
khaosdoctor
0
70
Entendendo o ecossistema de containers
khaosdoctor
1
980
Other Decks in Technology
See All in Technology
21st ACRi Webinar - Univ of Tokyo Presentation Slide (Ayumi Ohno)
nao_sumikawa
0
120
EM歴1年10ヶ月のぼくがぶち当たった苦悩とこれからへ向けて
maaaato
0
270
生成AI時代の自動E2Eテスト運用とPlaywright実践知_引持力哉
legalontechnologies
PRO
0
210
Sansanが実践する Platform EngineeringとSREの協創
sansantech
PRO
2
570
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
580
Playwright x GitHub Actionsで実現する「レビューしやすい」E2Eテストレポート
kinosuke01
0
320
A Compass of Thought: Guiding the Future of Test Automation ( #jassttokai25 , #jassttokai )
teyamagu
PRO
1
240
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
700
21st ACRi Webinar - Univ of Tokyo Presentation Slide (Shinya Takamaeda)
nao_sumikawa
0
120
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
250
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
140
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
120
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Side Projects
sachag
455
43k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Pragmatic Product Professional
lauravandoore
37
7.1k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Become a Pro
speakerdeck
PRO
31
5.7k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
4 Signs Your Business is Dying
shpigford
186
22k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Automating Front-end Workflow
addyosmani
1371
200k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
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