Hey, I can't find any official docs other than that you're the maintainer:
https://github.com/scrooloose/syntastic/wiki/TypeScript:---tslint
With jshint I didn't have to do anything special. I install pathogen, synastic, jshint, and create a .jshintrc and then whenever I save a file it does the linting for me.
With tslint I have everything installed, but nothing happens. What do I need to configure to make tslint run whenever there's a .ts file?
One possibility is that you're using tsc as your checker instead of tslint. I had to put the following in my .vimrc:
let g:syntastic_typescript_checkers = ['tslint']
tslint also needs a config file, which you can set with:
let g:syntastic_typescript_tslint_args = "--config /path/to/tslint.json"
I don't want a global tslint.json, I want it to read from whatever project I'm in. That's how jshint works. Is there some reason tslint doesn't work the same way?
Hmm...
bad
let g:syntastic_typescript_checkers = ['tsc', 'tslint']
good
let g:syntastic_typescript_checkers = ['tslint', 'tsc']
I'm not sure what's going on, but something about tsc is failing and caused it to not fall through to tslint.
Any updates on this? tslint is still not showing anything for me. I have the following configured
let g:syntastic_typescript_checkers = ['tslint']
let g:syntastic_typescript_tslint_args = "--config ~/.dotfiles/tslint.json"
And when I run :SyntasticInfo in my .ts file, I get that tslint is the current checker
Syntastic version: 3.7.0-54 (Vim 704, Darwin)
Info for filetype: typescript
Global mode: passive
Filetype typescript is passive
The current file will not be checked automatically
Available checkers: eslint tsc tslint
Currently enabled checker: tslint
Even running SyntasticCheck tslint is returning nothing.
@coolaj86, I saw you also commenting in the Syntastic issue thread about this as well. Did you manage to get everything working? I'd appreciate any help at all :)
coincidentally, I just recently switched back to using vim (from Atom) and syntastic + tslint is working fine for me. but I'm not using that second line in your config (tslint_args); I just let tslint find the config file. have you tried that? are you using the latest vim / macvim and syntastic?
@adidahiya Yeah I'm using the latest vim and syntastic. I removed the second config line and it still doesn't work. Strangely enough, if I run :make from within the buffer, it will show the errors I'm expecting (outside the buffer, then I hit enter and return to the buffer).
@coolaj86 Have you figured it out? I mean how to use local tsconfig.json? anybody have any ideas?
I've got local tsconfig.json working in my neovim (syntastic): https://github.com/vyorkin-personal/dots/blob/master/tag-vim/vim/plugin/syntastic.vim#L9, dunno what was the problem a couple of months ago, but now it works for some reason ¯\_(ツ)_/¯
I know this is a closed issue, but for anyone stopping by; I fixed this by installing typescript and tslint globally on my machine, and adding this to my vimrc:
let g:syntastic_typescript_checkers = ['tslint', 'tsuquyomi']
Most helpful comment
I don't want a global tslint.json, I want it to read from whatever project I'm in. That's how jshint works. Is there some reason tslint doesn't work the same way?