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
tslint plugin for prettier formatting
NOTE: This project is modified from eslint-plugin-prettier, ported to TSLint.
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
Related
License
MIT © Ika