TSLint Beautifier
About
TSLint beautifier for Unibeautify
| Package | Docs | Latest |
|---|---|---|
| @unibeautify/beautifier-tslint | v0.1.0 | |
| unibeautify | v0.17.1 | |
| tslint | v5.20.1 |
Install
Install with npm:
npm install --save-dev unibeautify tslint @unibeautify/beautifier-tslint
Or with yarn:
yarn add --dev unibeautify tslint @unibeautify/beautifier-tslint
Usage
Add TSLint to beautifiers language option.
A .unibeautifyrc.json file would look like the following:
{
"TypeScript": {
"beautifiers": [
"TSLint"
]
}
}
Advanced
The following beautifier option(s) are supported:
prefer_beautifier_config
See beautifier options docs for more information.
Example advanced configuration:
{
"TypeScript": {
"beautifiers": [
"TSLint"
],
"TSLint": {
"prefer_beautifier_config": true
}
}
}
Options
| Option | TypeScript |
|---|---|
| Arrow Parens | ✅ |
| End With Comma | ✅ |
FAQ
How to use TSLint in Atom, VSCode, and other editors?
See the editor integration documentation for installation instructions for your editor of choice.
How to use TSLint configuration file?
You can override Unibeautify configuration and use TSLint's own configuration file instead with prefer_beautifier_config beautifier option.
{
"LANGUAGE_NAME": {
"beautifiers": [
"TSLint"
],
"TSLint": {
"prefer_beautifier_config": "path/to/TSLint/config/file"
}
}
}
See beautifier options docs for more information.
How to enable TSLint to format on save?
See the editor integration documentation for format on save instructions for your editor of choice.
How to run TSLint on all files?
You can run TSLint on all of your files for every commit with Unibeautify CI.
Is there a TSLint sandbox or playground?
You can quickly try TSLint online with Unibeautify Playground.