简体   繁体   English

与jslint for vim同步不执行检查器

[英]Syntastic with jslint for vim not executing the checker

I have set up Syntastic https://github.com/scrooloose/syntastic with vim and I would like to use it for node.js javascript linting. 我已经用vim设置了Syntastic https://github.com/scrooloose/syntastic ,我想将它用于node.js javascript linting。

I have installed jslint 我已经安装了jslint

$ jslint routes/index.js

routes/index.js
 #1 Expected exactly one space between 'function' and '('.
    module.exports = function(app) { // Line 5, Pos 26
    ....

And I have put this in my ~/.vimrc 我把它放在我的~/.vimrc

let g:syntastic_jslint_checkers=['jslint']
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1

But I get no output on :SyntasticCheck 但是我在:SyntasticCheck上没有任何输出

Yet 然而

Syntastic: active mode enabled
Syntastic info for filetype: javascript
Available checker(s): jslint
Currently enabled checker(s): jslint

I recommend JSHint as an alternative for JavaScript linting in Vim. 我建议使用JSHint作为Vim中JavaScript替换的替代方法。 Here is a great answer that explains how to install it. 这是一个很好的答案 ,解释了如何安装它。

If you want to use JSHint for creating web sites as well, I'd additionally use RequireJS . 如果您也想使用JSHint来创建网站,那么我将另外使用RequireJS This way your JavaScript and your HTML code stay separated (JSHint can't deal with JavaScript inside HTML files). 这样,您的JavaScript和HTML代码保持分隔(JSHint无法处理HTML文件中的JavaScript)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM