Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntastic and jshint not displaying errors in vim

Tags:

vim

syntastic

I can't get Syntastic to work for JavaScript files in MacVim. If I save a file with errors in it, nothing is displayed: there is no error margin.

If I run :SyntasticInfo, then I see:

Syntastic info for filetype: javascript
Available checkers: jshint
Currently active checker(s): jshint

If I run jshint directly, using :!jshint %, then I see the errors I expect.

like image 559
Roger Lipscombe Avatar asked Feb 02 '26 21:02

Roger Lipscombe


1 Answers

I had a custom syntastic_javascript_jshint_conf setting:

let g:syntastic_javascript_jshint_conf="~/.jshintrc"

...and the ~/.jshintrc file was missing. Recreating it fixed the problem, and now I get the error margin.

Updated to add: I've added a feature to my .vimrc, so that it tracks the "nearest" .jshintrc file: https://github.com/rlipscombe/vimrc/blob/master/vimrc#L176

like image 119
Roger Lipscombe Avatar answered Feb 04 '26 13:02

Roger Lipscombe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!