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 生成AIガバナンスの全体像がわかる本
yoshimura_datam
0
140
Welcome JXL!
dynamis
0
1.3k
FPGAでアクティブセンシングがやりたくてカメラモジュールを自作した話
ryuz88
0
150
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
460
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
170
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
200
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
370
「正しいデータ」の定義をAI エージェントとつくるGoogleADKによるデータ品質定義の実践
takaha4k
0
150
AI時代のTechLeadの問い〜Tech Lead Conference 2026 Autumn / questions-for-tech-leads-in-the-age-of-ai
haru860
0
110
Claude Certified Developer – Professional 試験対策
shinoisa
0
300
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
410
技術書典で本を売る流れ
yoshimura_datam
0
210
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
410
A Modern Web Designer's Workflow
chriscoyier
699
190k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
690
Why Our Code Smells
bkeepers
PRO
340
58k
KATA
mclloyd
PRO
35
16k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
690
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
370
Unsuck your backbone
ammeep
672
58k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
4 Signs Your Business is Dying
shpigford
187
23k