From 212dcd0bf753f08c0127a26a71b673c734b45c02 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Thu, 5 Sep 2019 19:35:38 +0300 Subject: init commit, extracted vim config from i3rice --- .vim/autoload/neomake/makers/ft/typescript.vim | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .vim/autoload/neomake/makers/ft/typescript.vim (limited to '.vim/autoload/neomake/makers/ft/typescript.vim') diff --git a/.vim/autoload/neomake/makers/ft/typescript.vim b/.vim/autoload/neomake/makers/ft/typescript.vim new file mode 100644 index 0000000..4d011b7 --- /dev/null +++ b/.vim/autoload/neomake/makers/ft/typescript.vim @@ -0,0 +1,45 @@ +" vim: ts=4 sw=4 et + +function! neomake#makers#ft#typescript#EnabledMakers() abort + return ['tsc', 'tslint'] +endfunction + +function! neomake#makers#ft#typescript#tsc() abort + " tsc should not be passed a single file. + let maker = { + \ 'args': ['--noEmit', '--watch', 'false', '--pretty', 'false'], + \ 'append_file': 0, + \ 'errorformat': + \ '%E%f %#(%l\,%c): error %m,' . + \ '%E%f %#(%l\,%c): %m,' . + \ '%Eerror %m,' . + \ '%C%\s%\+%m' + \ } + let config = neomake#utils#FindGlobFile('tsconfig.json') + if !empty(config) + let maker.args += ['--project', config] + endif + return maker +endfunction + +function! neomake#makers#ft#typescript#tslint() abort + " NOTE: output format changed in tslint 5.12.0. + let maker = { + \ 'args': ['-t', 'prose'], + \ 'errorformat': '%-G,' + \ .'%EERROR: %f:%l:%c - %m,' + \ .'%WWARNING: %f:%l:%c - %m,' + \ .'%EERROR: %f[%l\, %c]: %m,' + \ .'%WWARNING: %f[%l\, %c]: %m', + \ } + let config = neomake#utils#FindGlobFile('tsconfig.json') + if !empty(config) + let maker.args += ['--project', config] + let maker.cwd = fnamemodify(config, ':h') + endif + return maker +endfunction + +function! neomake#makers#ft#typescript#eslint() abort + return neomake#makers#ft#javascript#eslint() +endfunction -- cgit v1.2.3