prettier-tslint

Formats your TypeScript using Prettier followed by tslint --fix

MIT 7 个版本
安装
npm install prettier-tslint
yarn add prettier-tslint
pnpm add prettier-tslint
bun add prettier-tslint
README

prettier-tslint

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

Travis Prettier npm semantic-release License

Install

With npm:

npm install --save-dev prettier-tslint

Or with yarn:

yarn add --dev prettier-tslint

prettier-tslint allows you to install your own version of prettier and typescript, so make sure you've installed them, too.

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, check } from "prettier-tslint";

check("file.ts"); // -> false
fix("file.ts");
check("file.ts"); // -> true

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

Contributing

See CONTRIBUTING.md

版本列表
0.4.2 2019-01-03
0.4.1 2018-12-11
0.4.0 2018-04-24
0.3.0 2017-10-21
0.2.0 2017-10-21
0.1.0 2017-10-15
0.0.0-development 2017-10-15