jshint的vim errorformat(带示例)

时间:2013-07-11 12:47:05

标签: vim errorformat

我正在尝试为此写efm:

file: app/assets/javascripts/topbar.js
  line 17, col 3, Missing semicolon.
  line 19, col 19, 'is_mobile' was used before it was defined.
  line 21, col 1965, Expected '{' and instead saw 'check'.
  line 25, col 18, 'onScroll' was used before it was defined.
file: app/assets/javascripts/trends.js
  line 2, col 55, Missing semicolon.
  line 6, col 27, 'trendTypeSelected' was used before it was defined.
  line 7, col 32, Expected '===' and instead saw '=='.
JSHint check failed

但我认为我在单独的行上错过了文件的概念。有人可以帮助我 这个?

这是我到目前为止所做的,它不起作用:

%-Pfile:\ %f,line\ %l\,\ col\ %c\,\ %m

谢谢!

解决方案:

set efm=%-Pfile:\ %f,%*[\ ]line\ %l\\,\ col\ %c\\,\ %m,%-Q,%-GJSHint\ check\ failed

1 个答案:

答案 0 :(得分:1)

Vim提供%P,将解析后的文件(%f)推送到堆栈,请参阅:help errorformat-separate-filename

因此,对于您的错误输出,它将类似于%+Pfile: %f,...