I love the Airbnb JavaScript Style Guide. Most of the rules also apply to TypeScript, but of course it doesn't cover specific TypeScript language features.
I have also found the Microsoft TypeScript Coding Guidelines but they are for the TypeScript project itself, not for projects that use TypeScript.
Finally I found the TypeScript Style Guide by Platypi but it's not as detailed as I'd like it to be. Is there another (official?) TypeScript Style Guide that I missed? Or are the two I listed the only ones that exist?
The TypeScript team doesn't issue an "official" style guide for other projects using TypeScript. The guidelines for working on the compiler itself are both too specific and not broad enough for general use; I would not use them as a baseline.
Any JavaScript style guide that is up-to-date for ES6 is going to cover nearly all TypeScript constructs except for type annotations, so I would start with your favorite JS style and decide on what you want the rules for type annotations to be.
TSLint is a good choice for enforcing style rules around types / type annotations.
Update: TSLint is currently deprectated in favour of ESLint.
Maybe this is a bit late, but I stumbled upon https://github.com/excelmicro/typescript which also provides a bit more detailed tslint.json in the linters folder ... it is also based on the airbnb/javascript styleguide ...
Yet another Styleguide (which we use for angular 1 development with TypeScript) is https://angular.io/guide/styleguide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With