【发布时间】:2014-11-19 15:30:24
【问题描述】:
我想在emacs中使用jslint,所以我安装了包flymake-jslint和flymake-cursor。
我有非常简单的 javascript 文件:
/*global desc, task, jake, fail, complete */
"use strict";
task("example", function() {
var x = 5
console.log("asdf");
});
Flymake 正确突出显示 var x = 5,我在迷你缓冲区中得到 Unused 'x'.。但是,当我从命令行运行 jslint 时,我得到:
$ jslint jakefile.js
jakefile.js
#1 Expected exactly one space between 'function' and '('.
task("example", function() { // Line 3, Pos 25
#2 Expected ';' and instead saw 'console'.
var x = 5 // Line 4, Pos 14
#3 Unused 'x'.
var x = 5 // Line 4, Pos 9
有没有办法配置flymake-jslint 向我显示那些非语法错误,例如“预期空间”?
【问题讨论】:
-
This 建议您可以在配置文件中设置选项:自定义 flymake-jslint 选项。在 Windows 上,将 flymake-jslint-command 设置为:~/.emacs.d/jslint.bat 或者,您应该能够添加
/*jslint white:false */(等)以确保对混乱空白的容忍度 off 逐个文件。但请先尝试配置路由。
标签: javascript emacs jslint flymake