Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tslint-plugin-prettier

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-plugin-prettier

Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
149K
increased by74.73%
Maintainers
1
Weekly downloads
 
Created
Source

tslint-plugin-prettier

npm build coverage dependencies devDependencies

Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

NOTE: This project uses official reporter from eslint-plugin-prettier.

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 to disable all prettier-related rules, so as to avoid conflicts between existed rules.

Options

If there is no option provided, it'll try to load config file if possible (require prettier@1.7.0+), uses Prettier's default option if not found.

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

If you'd like to specify options manually, just put Prettier Options in the second argument, for example:

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

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

Keywords

FAQs

Package last updated on 15 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc