Last active
April 18, 2017 14:42
-
-
Save KurtPreston/e3b385a97ab0cea549c6b89eac8efa58 to your computer and use it in GitHub Desktop.
VIM configuration for adding syntastic type checking rules to tslint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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