Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TypeScript tips that could save your life
Search
Lucas Santos
May 11, 2023
Technology
280
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
Transcript
43 slides
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
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
150
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
240
The future of JavaScript
khaosdoctor
0
110
É hora de falar sobre Deno
khaosdoctor
0
110
JS Software testing for beginners
khaosdoctor
0
120
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
88
The Dark Side of JavaScript
khaosdoctor
0
110
Integrating Containers Into JavaScript
khaosdoctor
0
100
Entendendo o ecossistema de containers
khaosdoctor
1
1.5k
Other Decks in Technology
See All in Technology
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.3k
Kubernetes, Agones, WebRTC, GPU で作る クラウドゲーミング基盤を本番運用に乗せるまで
vivion
1
310
PMの私の 最近のAgent Skills活用法
haru860
0
120
AI時代に問い直す「プロダクションミーティング」の価値 〜チームでサービスの信頼性を高める取り組み〜
mackerelio
0
230
Metadata - Section 4 : MODS (Metadata Object Description Schema )
mohab1
0
200
一口馬主の募集馬をAIで診断してみた
yoshimura_datam
0
130
正しくWeb サイトを守るためのコンテンツセキュリティーポリシー
hinalin
0
850
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1.1k
AI時代のTechLeadの問い〜Tech Lead Conference 2026 Autumn / questions-for-tech-leads-in-the-age-of-ai
haru860
0
120
データ界隈LT祭の運営のふりかえり
yoshimura_datam
0
120
コーディングできない僕にBobが舞い降りた
shumpei3
0
240
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
460
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
Being A Developer After 40
akosma
92
590k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Code Review Best Practice
trishagee
74
20k
Speed Design
sergeychernyshev
33
2.3k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
710
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
How to Ace a Technical Interview
jacobian
280
24k
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540