Here are my top 4 rules for how to name your types in TypeScript.
Never pluralize: Unless your type is an array type, you should make it singular - even if it's a union of members.
Casing: Choose a different casing between your values and your types. This helps stop syntax highlighting getting confused.
Type Parameters: prefix your type arguments with T. If you've got only one type argument, you can use T. Otherwise, be more descriptive with your parameter names.
Avoid Unnecessary Prefixes: Prefixes like IUser and TOrganization might feel useful, but they're mostly just holdovers from the Java days.
00:00 Intro
00:14 Never Pluralize
01:18 Casing
01:50 Type Parameters
02:44 Unnecessary Prefixes
03:35 Outro
Become a TypeScript Wizard with my free beginners TypeScript Course:
https://www.totaltypescript.com/tutor...
Follow Matt on Twitter
/ mattpocockuk
Join the Discord:
https://mattpocock.com/discord
Watch video This TS naming convention is weird online without registration, duration hours minute second in high quality. This video was added by user Matt Pocock 12 April 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 118,105 once and liked it 6.8 thousand people.