Skip to content

Commit 7e0bafd

Browse files
committed
Fix ignore
1 parent 6cc5d1c commit 7e0bafd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,19 @@ const processReport = (report, {isQuiet = false} = {}) => {
8282
return result;
8383
};
8484

85-
const runEslint = async (file, options, processorOptions) => {
85+
const runEslint = async (filePath, options, processorOptions) => {
86+
const filename = path.relative(options.cwd, filePath);
8687
const engine = new ESLint(options);
8788

88-
if (await engine.isPathIgnored(file)) {
89-
return getEmptyReport(file);
89+
if (
90+
micromatch.isMatch(filename, options.baseConfig.ignorePatterns)
91+
|| isGitIgnoredSync({cwd: options.cwd, ignore: options.baseConfig.ignorePatterns})(filePath)
92+
|| await engine.isPathIgnored(filePath)
93+
) {
94+
return;
9095
}
9196

92-
const report = await engine.lintFiles([file]);
97+
const report = await engine.lintFiles([filePath]);
9398
return processReport(report, processorOptions);
9499
};
95100

@@ -165,7 +170,7 @@ const lintFiles = async (patterns, inputOptions = {}) => {
165170
},
166171
);
167172

168-
return mergeReports(reports);
173+
return mergeReports(reports.filter(Boolean));
169174
};
170175

171176
const getFormatter = async name => {

0 commit comments

Comments
 (0)