mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Issue #2008 - Add jshint
This commit is contained in:
parent
1a1c5abca6
commit
19dbeaa23e
4 changed files with 71 additions and 0 deletions
28
test/reporter.js
Normal file
28
test/reporter.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
reporter: function (res) {
|
||||
var len = 0;
|
||||
var str = "";
|
||||
|
||||
res.forEach(function (r) {
|
||||
var file = r.file;
|
||||
var err = r.error;
|
||||
|
||||
switch(err.code) {
|
||||
case 'W004': // variable is already defined
|
||||
case 'W018': // confusing use of !
|
||||
break;
|
||||
default:
|
||||
len++;
|
||||
str += file + ": line " + err.line + ", col " +
|
||||
err.character + ", " + err.reason + "\n";
|
||||
}
|
||||
});
|
||||
|
||||
if (str) {
|
||||
process.stdout.write(str + "\n" + len + " error" +
|
||||
((len === 1) ? "" : "s") + "\n");
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue