gts1.0.0 • Public • Published
Google TypeScript Style
NOTE: THIS README refers to the master branch which corresponds to the upcoming 1.0 release. To view documentation for the currently released version of this module see: https://github.com/google/gts/tree/v0.9.x.
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 fixand 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.
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.jsonfile to your project that uses the Google TypeScript Style.
- Adds the necessary devDependencies to your
- Adds scripts to your
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.
prepare: convenience integrations.
The commands above will all run in the scope of the current folder. Some commands can be run on individual files:
gts check index.tsgts check one.ts two.ts three.tsgts check *.ts
Show your love for
gts and include a badge!
[![Code Style: Google]()]()
Made with ❤️ by the Google Node.js team.
NOTE: This is not an official Google product.