Skip to content

Commit

Permalink
Add support for tslint --fix (sbdchd#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinabox authored and sbdchd committed Dec 17, 2018
1 parent 5ea3abc commit 49d7098
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ that caused Neoformat to be invoked.
- [`terraform`](https://www.terraform.io/docs/commands/fmt.html),
- Typescript
- [`tsfmt`](https://github.com/vvakame/typescript-formatter),
[`prettier`](https://github.com/prettier/prettier)
[`prettier`](https://github.com/prettier/prettier),
[`tslint`](https://palantir.github.io/tslint)
- VALA
- [`uncrustify`](http://uncrustify.sourceforge.net)
- Vue
Expand Down
10 changes: 9 additions & 1 deletion autoload/neoformat/formatters/typescript.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function! neoformat#formatters#typescript#enabled() abort
return ['tsfmt', 'prettier']
return ['tsfmt', 'prettier', 'tslint']
endfunction

function! neoformat#formatters#typescript#tsfmt() abort
Expand All @@ -17,3 +17,11 @@ function! neoformat#formatters#typescript#prettier() abort
\ 'stdin': 1
\ }
endfunction

function! neoformat#formatters#typescript#tslint() abort
return {
\ 'exe': 'tslint',
\ 'args': ['--fix', '-c tslint.json'],
\ 'replace': 1
\ }
endfunction
4 changes: 3 additions & 1 deletion doc/neoformat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
- Terraform
- [`terraform`](https://www.terraform.io/docs/commands/fmt.html)
- Typescript
- [`tsfmt`](https://github.com/vvakame/typescript-formatter)
- [`tsfmt`](https://github.com/vvakame/typescript-formatter),
[`prettier`](https://github.com/prettier/prettier),
[`tslint`](https://palantir.github.io/tslint)
- VALA
- [`uncrustify`](http://uncrustify.sourceforge.net)
- Vue
Expand Down

0 comments on commit 49d7098

Please sign in to comment.