jscs.vim 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "============================================================================
  2. "File: jscs.vim
  3. "Description: Javascript syntax checker - using jscs
  4. "Maintainer: LCD 47 <lcd047@gmail.com>
  5. "License: This program is free software. It comes without any warranty,
  6. " to the extent permitted by applicable law. You can redistribute
  7. " it and/or modify it under the terms of the Do What The Fuck You
  8. " Want To Public License, Version 2, as published by Sam Hocevar.
  9. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  10. "============================================================================
  11. if exists('g:loaded_syntastic_javascript_jscs_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_javascript_jscs_checker = 1
  15. if !exists('g:syntastic_javascript_jscs_sort')
  16. let g:syntastic_javascript_jscs_sort = 1
  17. endif
  18. let s:save_cpo = &cpo
  19. set cpo&vim
  20. function! SyntaxCheckers_javascript_jscs_GetLocList() dict
  21. let makeprg = self.makeprgBuild({ 'args_after': '--no-colors --reporter checkstyle' })
  22. let errorformat = '%f:%t:%l:%c:%m'
  23. return SyntasticMake({
  24. \ 'makeprg': makeprg,
  25. \ 'errorformat': errorformat,
  26. \ 'subtype': 'Style',
  27. \ 'preprocess': 'checkstyle',
  28. \ 'returns': [0, 2] })
  29. endfunction
  30. call g:SyntasticRegistry.CreateAndRegisterChecker({
  31. \ 'filetype': 'javascript',
  32. \ 'name': 'jscs'})
  33. let &cpo = s:save_cpo
  34. unlet s:save_cpo
  35. " vim: set sw=4 sts=4 et fdm=marker: