VIM + JSLint?

前端 未结 6 2101
花落未央
花落未央 2020-11-28 16:56

I spend my days in vim, currently writing a lot of JavaScript. I\'ve been trying to find a way to integrate JSLint or something similar into vim to improve my coding. Has an

6条回答
  •  Happy的楠姐
    2020-11-28 17:58

    I've been very happy using node-lint

    sudo npm -g install jslint
    

    Then whack this somewhere in your .vim

    set makeprg=jslint\ %
    set errorformat=%-P%f,
            \%E%>\ #%n\ %m,%Z%.%#Line\ %l\\,\ Pos\ %c,
            \%-G%f\ is\ OK.,%-Q
    

    Now a :make will run jslint. Errors appear in the quickfix window.

提交回复
热议问题