Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.03 KB

coding.md

File metadata and controls

28 lines (19 loc) · 1.03 KB

Coding

Both general programming and specific TS rules live in this document

if the rule can be formalized, be sure to think about writing a custom linter rule before adding it here

General

TypeScript

Prefer union types over enums

Class member accessibility format

  • public members - always without public keyword(controlled by eslint)
  • private/protected with private/protected keyword and trailing underscore

    NOTE: in future we want to be closer to native JS and use JS private fields(with #) but now trailing _ is trade-off between reading and transpile

class Foo {
    bar = 'public-field'
    private someSecret_ = 'private value'
}