Skip to content

Commit

Permalink
Improve performance (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Nov 20, 2022
1 parent b15cbfe commit 9bee815
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions index.js
Expand Up @@ -53,7 +53,7 @@ const lintText = async (string, options) => {
filePath
&& (
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
|| isGitIgnoredSync({cwd, ignore: ignorePatterns})(filePath)
|| isGitIgnoredSync({cwd})(filePath)
)
) {
return getIgnoredReport(filePath);
Expand Down Expand Up @@ -87,16 +87,11 @@ const lintFiles = async (patterns, options) => {
for (const options of filesWithOptions) {
const {filePath, eslintOptions} = options;
const {cwd, baseConfig: {ignorePatterns}} = eslintOptions;
if (filePath
&& (
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
|| isGitIgnoredSync({cwd, ignore: ignorePatterns})(filePath)
)) {
continue;
}

// eslint-disable-next-line no-await-in-loop
if ((await eslint.isPathIgnored(filePath))) {
if (
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
// eslint-disable-next-line no-await-in-loop
|| await eslint.isPathIgnored(filePath)
) {
continue;
}

Expand Down

0 comments on commit 9bee815

Please sign in to comment.