Created
July 23, 2013 06:34
-
-
Save kawacho/6060268 to your computer and use it in GitHub Desktop.
JSHint のカスタムレポーター。
「ファイル名(行番号, 桁番号): ...」という書式で出力するので、Visual Studio の外部ツールとして実行 → 出力ウィンドウのダブルクリックで指摘位置にジャンプ可能。 jshint --reporter="jshint-reporter-vs.js" ... のように使う。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global module, process */ | |
module.exports = { | |
reporter: function (res) { | |
var len = res.length; | |
if (len === 0) { | |
return; | |
} | |
for (var i = 0; i < len; i++) { | |
var file = res[i].file; | |
var err = res[i].error; | |
process.stdout.write( | |
file + "(" + err.line + ", " + err.character + "): " + | |
err.reason + " (" + err.code + ")" + "\n"); | |
} | |
process.stdout.write("\n"); | |
process.stdout.write(len + " error" + ((len === 1) ? "" : "s") + "\n"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment