I want to use the syntastic
plugin for vim
to give me live error checking while I'm writing typescript files, using tsc
. I already have tsc
activated in vim
. Any suggestions for how I could get tsc
to use the closest parent's tsconfig.json
file as configuration? I find that tsc
doesn't do so by default, which makes syntastic
configuration difficult. Thanks!
EDIT: The reason I think it's not using tsconfig.json
is because options like the module resolution method doesn't seem to be working ("require" not defined), and it also isn't catching my definition files as defined in the files
attribute in tsconfig.json
.
My failed attempt to solve this:
let g:syntastic_typescript_checks=['tsc', 'tslint']
" typescript: find tsconfig.json
function! FindTypescriptRoot()
return fnamemodify(findfile('tsconfig.json', './;'), ':h')
endfunction
let g:syntastic_typescript_tsc_args=['-p', FindTypescriptRoot()]
This results in Syntastic spitting out to me this error:
app.ts|| TS5042: Option 'project' cannot be mixed with source files on a command line.
This is probably because it's running a command like tsc -p /path/to/project/ app.ts
, which is an illegal use of that flag... But I don't understand why my settings in tsconfig.json
are being ignored by syntastic
:(