Skip to content

Commit

Permalink
[[FIX]] Honor "ignore" file when linting STDIN
Browse files Browse the repository at this point in the history
  • Loading branch information
CatTail authored and jugglinmike committed Jan 8, 2017
1 parent c63d4d5 commit d4f83a4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,18 +610,18 @@ var exports = {
}
}

if (opts.useStdin) {
var filename;

// There is an if(filename) check in the lint() function called below.
// passing a filename of undefined is the same as calling the function
// without a filename. If there is no opts.filename, filename remains
// undefined and lint() is effectively called with 4 parameters.
if (opts.filename) {
filename = path.resolve(opts.filename);
}
if (opts.useStdin && opts.ignores.indexOf(filename) === -1) {
cli.withStdin(function(code) {
var config = opts.config;
var filename;

// There is an if(filename) check in the lint() function called below.
// passing a filename of undefined is the same as calling the function
// without a filename. If there is no opts.filename, filename remains
// undefined and lint() is effectively called with 4 parameters.
if (opts.filename) {
filename = path.resolve(opts.filename);
}

if (filename && !config) {
config = exports.getConfig(filename);
Expand All @@ -634,8 +634,8 @@ var exports = {
lint(extract(code, opts.extract), results, config, data, filename);
(opts.reporter || defReporter)(results, data, { verbose: opts.verbose });
cb(results.length === 0);
});

});
return null;
}

Expand Down

0 comments on commit d4f83a4

Please sign in to comment.