TypeScript - class naming convention

24 points
Created by:

This article explains the rules for class naming convention used in TypeScript.

The class naming convention defines the following rules:

  1. Use PascalCase for class names.
  2. Use camelCase for class members.
  3. Use whole words in names when possible.

Class naming convention example:

class Square {

    get name(): string {
        return 'Square';
    public computePerimeter(aSize: number, bSize: number): number {
        return 2 * aSize + 2 * bSize;

    public computeArea(aSize: number, bSize: number): number {
        return aSize * bSize;

    public toString(): string {
        return `[ ${} object ]`;

See also

  1. Programming - PascalCase definition with example

  2. Programming - camelCase definition with example


  1. TypeScript Handbook Class - Microsoft Github Docs
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

â€ïžđŸ’» 🙂