TypeScript tipsthat could save your life
View Slide
who am I_{twitter, youtube, linkedin…}.lsantos.devsoftware engineer_[email protected]
typescript can be tricky sometimes
so let's cut to the chase_
tsconfig extension_
It's not only for bases
type_ testing
one native way: *.typetest.ts files
one native way: *.typetest.ts fileshttps://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
even better
but well… Why isn't this working
but well… Why isn't this workingTo be continued…
but there's another example
type guards_
now we have something
but this if…
assertion functions
assertion out of tests
understand your enums_
enums produce valid JavaScript
numeric enums
string enums
constant enums
obrigado_lsantos.dev