standard.vim 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. "============================================================================
  2. "File: standard.vim
  3. "Description: JavaScript syntax checker - using standard
  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_standard_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_javascript_standard_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_javascript_standard_IsAvailable() dict
  18. if !executable(self.getExec())
  19. return 0
  20. endif
  21. return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1])
  22. endfunction
  23. function! SyntaxCheckers_javascript_standard_GetLocList() dict
  24. let makeprg = self.makeprgBuild({ 'args': '-v' })
  25. let errorformat = ' %f:%l:%c: %m'
  26. return SyntasticMake({
  27. \ 'makeprg': makeprg,
  28. \ 'errorformat': errorformat,
  29. \ 'subtype': 'Style',
  30. \ 'defaults': {'type': 'W'},
  31. \ 'returns': [0, 1] })
  32. endfunction
  33. call g:SyntasticRegistry.CreateAndRegisterChecker({
  34. \ 'filetype': 'javascript',
  35. \ 'name': 'standard'})
  36. let &cpo = s:save_cpo
  37. unlet s:save_cpo
  38. " vim: set sw=4 sts=4 et fdm=marker: