Myvideo

Guest

Login

This TS naming convention is weird

Uploaded By: Myvideo
1 view
0
0 votes
0

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://w ... #MattPocock 20230412 qA65QjWCl60

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later