The Wayback Machine - https://web.archive.org/web/20190629091704/https://github.com/google/gts
Skip to content
☂️ TypeScript style guide, formatter, and linter.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ci/docker/windows build: Configure Cirrus CI for Windows (#332) May 13, 2019
src chore(deps): upgrade typescript to ~3.5.0 (#356) May 29, 2019
template feat: install a default src template (#340) May 14, 2019
test fix: avoid conflicts between prettier and tslint (#348) May 17, 2019
.cirrus.yml build: use correct task names in the CI config (#345) May 13, 2019
.gitignore build: configuring windows build with kokoro (#328) May 1, 2019
CODE_OF_CONDUCT.md fix: add Code of Conduct (#262) Feb 12, 2019
CONTRIBUTING.md feat: initial version Aug 1, 2017
LICENSE feat: initial version Aug 1, 2017
README.md feat: install a default src template (#340) May 14, 2019
package-lock.json chore(deps): lock file maintenance (#361) Jun 24, 2019
package.json chore(deps): upgrade typescript to ~3.5.0 (#356) May 29, 2019
prettier.config.js feat!: switch to prettier for formatting (#259) Feb 7, 2019
renovate.json chore: remove gitAuthor from renovate.json (#229) Nov 27, 2018
synth.metadata build: configuring windows build with kokoro (#328) May 1, 2019
synth.py build: configuring windows build with kokoro (#328) May 1, 2019
tsconfig-google.json feat!: change output target to es2017 (#255) Feb 7, 2019
tsconfig.json feat: install a default src template (#340) May 14, 2019
tslint-rules.json fix: avoid conflicts between prettier and tslint (#348) May 17, 2019
tslint.json fix: avoid conflicts between prettier and tslint (#348) May 17, 2019

README.md

gts

Google TypeScript Style

NPM Version CircleCI Dependency Status Known Vulnerabilities codecov TypeScript Style Guide

gts is Google's TypeScript style guide, and the configuration for our formatter, linter, and automatic code fixer. No lint rules to edit, no configuration to update, no more bike shedding over syntax.

To borrow from standardjs:

  • No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
  • Automatically format code. Just run gts fix and say goodbye to messy or inconsistent code.
  • Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor.
  • Opinionated, but not to a fault. We recommend you use the default configuration, but if you need to customize compiler or linter config, you can.

Under the covers, we use tslint to enforce the style guide and provide automated fixes, and prettier to re-format code.

Getting Started

The easiest way to get started is to run:

npx gts init

How it works

When you run the npx gts init command, it's going to do a few things for you:

  • Adds an opinionated tsconfig.json file to your project that uses the Google TypeScript Style.
  • Adds the necessary devDependencies to your package.json.
  • Adds scripts to your package.json:
    • check: Lints and checks for formatting problems.
    • fix: Automatically fixes formatting and linting problems (if possible).
    • clean: Removes output files.
    • compile: Compiles the source code using TypeScript compiler.
    • pretest, posttest and prepare: convenience integrations.
  • If a source folder is not already present it will add a default template project.

Individual files

The commands above will all run in the scope of the current folder. Some commands can be run on individual files:

gts check index.ts
gts check one.ts two.ts three.ts
gts check *.ts

Badge

Show your love for gts and include a badge!

Code Style: Google

[![Code Style: Google](https://img.shields.io/badge/code%20style-google-blueviolet.svg)](https://github.com/google/gts)

License

Apache-2.0


Made with ❤️ by the Google Node.js team.

NOTE: This is not an official Google product.

You can’t perform that action at this time.