Skip to content

Commit

Permalink
lint: revert reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Melyukov committed Jun 22, 2017
1 parent bdd2423 commit 39ac758
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
4 changes: 1 addition & 3 deletions lib/lint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ function lint(config){
unusedL10n.warn(flow);
}

},
function(flow){
flow.result = require('./reporter/process-warns')(flow, options);
flow.result = require('./reporter/process-warns')(flow.warns, options.filter);
}
]);

Expand Down
28 changes: 1 addition & 27 deletions lib/lint/reporter/process-warns.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
var isChildProcess = typeof process.send == 'function'; // child process has send method

module.exports = function(flow, options){
module.exports = function(warns, fileFilter){
var result = {};
var warns = flow.warns;
var fileFilter = options.filter;

warns.forEach(function(warn){
var filename = warn.file || '<UnknownFile>';
Expand All @@ -20,27 +16,5 @@ module.exports = function(flow, options){
});
});

if (!isChildProcess)
{
if (options.warnUnusedL10n && flow.usedL10nTokens)
{
var usedL10nTokensInfo = flow.usedL10nTokens;

for (var dictFileName in usedL10nTokensInfo.items){
var tokenNames = usedL10nTokensInfo.items[dictFileName];

for (var tokenName in tokenNames) {
if (!tokenNames[tokenName]) {
result[dictFileName] = result[dictFileName] || [];
result[dictFileName].push({
loc: dictFileName,
message: tokenName
});
}
}
}
}
}

return result;
};

0 comments on commit 39ac758

Please sign in to comment.