Coding Styles
In this chapter you’ll find some high-level conventions for coding in TypeScript. If you’re looking for a thorough guide, check out idomatic.js[1] or AirBnB’s ES6 style guide[2].
#Types
- Arrays should be defined like this
type[], notArray<type>. - Create an
interfacerather than using theanytype.
Theanykeyword should only be used if absolutely necessary.
#Naming
constshould use UPPEER_SNAKE_CASE[3]classnames should always be written in PascalCase.[4]interfacenames should alawys start with a capital “I” and use PascalCase, e.g.IMarvelCharacter.