JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 77336
  • Score
    100M100P100Q161336F
  • License MIT

tslint plugin for prettier formatting

Package Exports

  • tslint-plugin-prettier
  • tslint-plugin-prettier/rules

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslint-plugin-prettier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tslint-plugin-prettier

npm build coverage dependencies devDependencies

tslint plugin for prettier formatting

NOTE: This project is modified from eslint-plugin-prettier, ported to TSLint.

Changelog

Sample

a();;;
//  ~~
;;;
//~ [Delete `;;⏎;;;`]
var foo = ''
//        ~~ [Replace `''` with `"";⏎`]
var foo= "";
//     ~ [Insert `·`]

Install

# using npm
npm install --save-dev tslint-plugin-prettier prettier

# using yarn
yarn add --dev tslint-plugin-prettier prettier

Usage

(tslint.json)

for tslint@5.0.0+

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

for tslint@5.2.0+

{
  "rulesDirectory": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

NOTE: To use this plugin, it'd better to also use tslint-config-prettier-ext to disable all prettier-related rules, so as to avoid conflicts between existed rules.

Options

Same as Prettier Options, for example:

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": [true, { "singleQuote": true }]
  }
}

Development

# lint
yarn run lint

# format
yarn run format

# build
yarn run build

# test
yarn run test

License

MIT © Ika