Skip to content

SafelyTyped/ts-coding-standards

Repository files navigation

Coding Standards

This repo holds the coding standards for any Typescript project managed by the SafelyTyped community.

Feel free to adopt them for your own community too :)

Introduction

The Safe Types movement is, at heart, an initiative to improve software quality. We've chosen to do that by moving defensive programming from literally everywhere (or nowhere, for projects that don't do any defensive programming) into type constructors.

That simple statement hides a lot of complexity. There's a lot that goes into making a safe type:

as well as helping us maintain the code and run the project for the long-term.

Why Do We Need Coding Standards At All?

Written coding standards are designed to ensure an acceptable level of consistent software quality across our projects.

That's doing a lot of heavy lifting. Let's break it down.

  • The whole point of the SafelyTyped projects is to give you tools to raise the quality of your software.
  • To achieve that, we believe it's important that all of our code is written, tested and documented to (at least!) the same standard.
  • We don't believe that it's possible to achieve consistency unless that standard itself has been documented in a way that's easy to understand.

Even in an office environment - where people can quickly and easily discuss things face-to-face - they are helpful. On a distributed project - where discussions don't happen in real-time, and where contributors can be infrequent - they are essential.

Where Do These Standards Come From?

They're based on the approach that Stuart has developed and refined over the last 25 years of working on software quality and assurance.

Watch this video to see Stuart talking about this approach:

Thumbnail of the Coding Standards Video Title Screen

The Standards

See STANDARDS.md for the all-in-one-document list.

Glossary

We've put together a comprehensive GLOSSARY.md to explain all of the jargon that we commonly use in the Safely Typed projects.

About

Coding standards for Typescript repos

Resources

License

Stars

Watchers

Forks