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
2026-11-16 JAWS-UG コンテナ支部 #31 ゆるLT大会 ECR のライフサイクルポリシーを いい感じに設定したい / ECR Lifecycle policy
masasuzu
3
620
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
2
250
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
470
コーディングできない僕にBobが舞い降りた
shumpei3
0
200
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
210
OCI Artifact による自動運転タクシーに向けた OTA 基盤の構築
biwashi
1
300
セキュリティチームは どのコンテナイメージの脆弱性対応を優先すべきか 〜CISA新指針とSCCで作る脆弱性トリアージ〜
swdtkuy
0
330
Is the Website Dying?
miriamschwab
0
160
Welcome JXL!
dynamis
0
120
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
1
660
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
300
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
590
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
970
Typedesign – Prime Four
hannesfritz
42
3.2k
Abbi's Birthday
coloredviolet
5
11k
Embracing the Ebb and Flow
colly
88
5.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
390
We Are The Robots
honzajavorek
0
460
A Modern Web Designer's Workflow
chriscoyier
699
190k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680