Skip to content

Commit 9bee815

Browse files
authored
Improve performance (#697)
1 parent b15cbfe commit 9bee815

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

index.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const lintText = async (string, options) => {
5353
filePath
5454
&& (
5555
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
56-
|| isGitIgnoredSync({cwd, ignore: ignorePatterns})(filePath)
56+
|| isGitIgnoredSync({cwd})(filePath)
5757
)
5858
) {
5959
return getIgnoredReport(filePath);
@@ -87,16 +87,11 @@ const lintFiles = async (patterns, options) => {
8787
for (const options of filesWithOptions) {
8888
const {filePath, eslintOptions} = options;
8989
const {cwd, baseConfig: {ignorePatterns}} = eslintOptions;
90-
if (filePath
91-
&& (
92-
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
93-
|| isGitIgnoredSync({cwd, ignore: ignorePatterns})(filePath)
94-
)) {
95-
continue;
96-
}
97-
98-
// eslint-disable-next-line no-await-in-loop
99-
if ((await eslint.isPathIgnored(filePath))) {
90+
if (
91+
micromatch.isMatch(path.relative(cwd, filePath), ignorePatterns)
92+
// eslint-disable-next-line no-await-in-loop
93+
|| await eslint.isPathIgnored(filePath)
94+
) {
10095
continue;
10196
}
10297

0 commit comments

Comments
 (0)