Skip to content

Instantly share code, notes, and snippets.

@KurtPreston
Last active April 18, 2017 14:42
Show Gist options
  • Save KurtPreston/e3b385a97ab0cea549c6b89eac8efa58 to your computer and use it in GitHub Desktop.
Save KurtPreston/e3b385a97ab0cea549c6b89eac8efa58 to your computer and use it in GitHub Desktop.
VIM configuration for adding syntastic type checking rules to tslint
function SetTslintOptions()
if exists(':TsuStartServer')
" If tsuquyomi is installed, ask for the config file name
let tsconfig = tsuquyomi#tsClient#tsProjectInfo(@%, 0)['configFileName']
" TODO: pull the version number out of syntastic.
let tslint_version = system('tslint --version')[0]
if tslint_version >= 5
" tslint v5 requires tsconfig file specified for some rules
let g:syntastic_typescript_tslint_args = '--type-check -p ' . tsconfig
endif
endif
endfunction
autocmd Filetype typescript call SetTslintOptions()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment