/typescript-guidelines

TypeScript writing guidelines

MIT LicenseMIT

Typescript Guidelines

This is a guideline on how to write effective TypeScript with the least effort. It touch on coding style, linting, to recommendation on writing good typings and writing TypeScript code.

Since the beginning of this project, the TypeScript team has added a lot of information its documentation. So make sure you have time to check it out.

For writing typings, also check out https://github.com/types/guidelines

Design Principles

  • Get the best out of TypeScript
  • Stay close to JavaScript as much as possible
  • Embrace latest JavaScript syntax
  • Cross-compatibility with tools. In my company, we embrace diversity and support team member to use their favorite IDEs. However it is really frustrating when the tools do not get along with each other!

Disclaimer

Recently I do most of my work in VS Code. So if you find that some of the guidelines doesn't work well in your IDE, let me know and we can see how to get it working on your IDE.

Table of Contents

Contributing

  • Follow the markdown style guide

  • Each section heading should be neutral, e.g. "var keyword" instead of "avoid var"

    Why? The heading would be used as link. So if the style guide suggestion changes, keeping the heading neutral would avoid broken links.