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

fix: stop linting files after an error #18155

Merged
merged 1 commit into from Feb 28, 2024
Merged

fix: stop linting files after an error #18155

merged 1 commit into from Feb 28, 2024

Conversation

fasttime
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Fixes #17621

What changes did you make? (Give an overview)

This PR adds functionality in ESLint.#lintFiles() to cancel parallel tasks after an error occurs. The tasks spawn by Promise.all() contain only one asynchronous operation, which is the file access by readFile, where each task reads a different file. If an error occurs in one of the tasks, the other pending tasks will be canceled with an exception during or immediately after the file access.

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Feb 28, 2024
@github-actions github-actions bot added cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features labels Feb 28, 2024
Copy link

netlify bot commented Feb 28, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit b3892c2
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/65decbfa6436750008d00db1

@fasttime
Copy link
Member Author

Not sure if autolabeling as cli was correct.

@fasttime fasttime marked this pull request as ready for review February 28, 2024 06:40
@fasttime fasttime requested a review from a team as a code owner February 28, 2024 06:40
Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I'll leave it open for others to review.

@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Feb 28, 2024
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Would like @nzakas to verify before merging.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant!

@nzakas nzakas merged commit af6e170 into main Feb 28, 2024
18 checks passed
@nzakas nzakas deleted the issue-17621 branch February 28, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Bug: [flat config] ESLint continues linting files after an error occurs
4 participants