Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Coding guidelines

Yury Delendik edited this page Feb 21, 2018 · 4 revisions

Coding guidelines

TBD

TypeScript

Coding guidelines for the TypeScript code will be loosely derived from the TypeScript's guidelines

Names / Identifiers

  • Use PascalCase for type names and enum values
    • in some cases enum values can be in ALL_CAPS
  • Use camelCase for function names and variables
  • Use whole words in names

Types

  • Annotate types for function arguments and result
  • Use of any is discouraged

Comments

  • Unless it is a JSDoc comment, use single line comment //
  • Don't comment unused code, remove it

Style

  • Use 2 spaces per indentation
  • Use arrow functions over anonymous function expressions and obj.xxx.bind(obj, ...)
  • Use double quotes for strings

JavaScript

JavaScript is similar to the TypeScript style. It just does not require type annotations.

Clone this wiki locally