I am trying to get makeprg and errorformat working with VIM and jslint, and can't seem to get the error format right for the life of me... I am using the nodejs version of jslint which produces results like:
1 116,9: The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
for (var k in o)
I basically want to match the line number, and column and the error and use the current file for the filename. Anyone know how to do this?
To be clear, I am looking for the errorformat to get this command working. Currently my .vimrc file has
augroup js
set makeprg=jslint\ %
set errorformat=%E%>%l,%c:%m,%Z
augroup END
which just isn't working (the jslint works fine, but the errorformat is wrong)...
An old thread, but for anyone coming across it, like myself:
For the current version of node-jslint installed through npm (v0.1.2), the error output looks like the following:
filename.js
#1 Missing 'use strict' statement.
y = x // Line 2, Pos 3
#2 Expected 'y' at column 5, not column 3.
y = x // Line 2, Pos 3
I'm using the following efm to parse the errors:
autocmd FileType javascript set efm=%-P%f,
\%E%>\ #%n\ %m,%Z%.%#Line\ %l\\,\ Pos\ %c,
\%-G%f\ is\ OK.,%-Q
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With