TypeScript Naming Conventions: Interfaces, Types, Enums & More

5 min read

TypeScript inherits JavaScript conventions and adds rules for its type system features.

TypeScript-Specific Rules

ItemConventionExample
InterfacesPascalCase (no I prefix)UserProps
Type aliasesPascalCaseApiResponse
EnumsPascalCaseenum Direction
Enum membersPascalCaseDirection.North
GenericsSingle uppercaseT, K, V
Utility typesPascalCasePartial<T>, Readonly<T>

No "I" Prefix for Interfaces

The TypeScript team explicitly discourages the Hungarian-style IUser pattern. Use User for the interface and UserImpl or a descriptive name for implementations.

File Naming

React components: UserProfile.tsx (PascalCase). Everything else: userUtils.ts (camelCase) or user-utils.ts (kebab-case).

Convert

PascalCase, camelCase. Hub.