Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lintFiles #697

Merged
merged 5 commits into from Nov 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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