Skip to content

Commit

Permalink
Fix ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Aug 6, 2021
1 parent 6cc5d1c commit 228eed8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@ const processReport = (report, {isQuiet = false} = {}) => {
return result;
};

const runEslint = async (file, options, processorOptions) => {
const runEslint = async (filePath, options, processorOptions) => {
const filename = path.relative(options.cwd, filePath);
const engine = new ESLint(options);

if (await engine.isPathIgnored(file)) {
return getEmptyReport(file);
if (
micromatch.isMatch(filename, options.baseConfig.ignorePatterns)
|| isGitIgnoredSync({cwd: options.cwd, ignore: options.baseConfig.ignorePatterns})(filePath)
|| await engine.isPathIgnored(filePath)
) {
return;
}

const report = await engine.lintFiles([file]);
const report = await engine.lintFiles([filePath]);
return processReport(report, processorOptions);
};

Expand Down

0 comments on commit 228eed8

Please sign in to comment.