vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

Request: semistandard (javascript) #1460

Closed rstacruz closed 9 years ago

rstacruz commented 9 years ago

https://github.com/Flet/semistandard

syntastic already has a standard reporter. semistandard is a drop-in replacement for standard (to enable semicolons).

lcd047 commented 9 years ago

Good news: you can use it with syntastic without changes:

let g:syntastic_javascript_standard_exec = 'semistandard'
fourcolors commented 9 years ago

This doesn't seem to work for me...standard works fine however

lcd047 commented 9 years ago

@fourcolors What did you do, what did you expect to happen, and what happened instead?

fourcolors commented 9 years ago

Hi lcd047 !

Ok I figured out what the problem was. It just threw me off that I needed to set my checker to 'standard' and the standard_exec to 'semistandard' but it makes sense now haha. Ok so basically yes your line works BUT you must have this line in your vimrc file as well.

let g:syntastic_javascript_checkers = ['standard']

So you need both. Thank you for responding so quickly! Sorry about that.

lcd047 commented 9 years ago

@fourcolors The syntastic checker standard handles both, yes. But you don't need to have both binaries standard and semistandard installed.

On the other hand, if you do have both binaries installed, you can switch between using them on the fly by pointing g:syntastic_javascript_standard_exec alternatively to standard and semistandard, but only with relatively recent versions of syntastic. With older versions you need to restart Vim if you change g:syntastic_javascript_standard_exec.

fourcolors commented 9 years ago

Ah, thank you for the clarification.

rstacruz commented 9 years ago

btw here's what I do on my vim config:

command! Standard :call <SID>standard()
command! Semistandard :call <SID>semistandard()

function! s:standard()
  let g:syntastic_javascript_checkers = ['standard']
  let g:syntastic_javascript_standard_exec = 'standard'
  SyntasticCheck
endfunction

function! s:semistandard()
  let g:syntastic_javascript_checkers = ['standard']
  let g:syntastic_javascript_standard_exec = 'semistandard'
  SyntasticCheck
endfunction

...I just then run :Standard when I need it. Have these set up for other linters as well.