Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.91 KB

README.md

File metadata and controls

63 lines (43 loc) · 1.91 KB

prettier-tslint

Formats your TypeScript using prettier followed by tslint --fix.

Travis Prettier npm semantic-release License

⚠️ WIP - check back soon!

Install

With npm:

npm install --save-dev prettier-tslint

Or with yarn:

yarn add --dev prettier-tslint

Configuration

prettier-tslint find and will respect:

  • prettier's .prettierrc, or any other config file such as package.json.
  • prettier's .prettierignore file.
  • tslint's tslint.json

prettier-tslint has no additional configuration.

CLI

Commands:
  fix    Fix one or more files
  check  List files that aren't formatted

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Examples:
  prettier-tslint fix file1.ts file2.ts  Fix provided files
  prettier-tslint fix '**/*.ts'          Fix all TypeScript files
  prettier-tslint check '**/*.ts'        List all unformatted TypeScript files

API

import { fix } from "prettier-tslint";

fix("file.ts");

Currently the fix function will write to disk and not return anything. This behavior will change in a minor release before 1.0.0 is released.