Skip to content

feat: prune suppressions for non-existent files #19825

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

TKDev7
Copy link
Contributor

@TKDev7 TKDev7 commented Jun 6, 2025

Prerequisites checklist

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

[ ] Documentation update
[ ] 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
[x] Other, please explain:

What changes did you make? (Give an overview)

When using --prune-suppressions, remove suppressions for files that don't exist on disk.

Fixes #19778

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

@TKDev7 TKDev7 requested a review from a team as a code owner June 6, 2025 05:59
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 6, 2025
Copy link

linux-foundation-easycla bot commented Jun 6, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Jun 6, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 998ee5f
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/684283c0966d400008a96612
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Jun 6, 2025
@fasttime fasttime added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jun 6, 2025
@fasttime fasttime moved this from Needs Triage to Second Review Needed in Triage Jun 6, 2025
@fasttime fasttime moved this from Second Review Needed to Implementing in Triage Jun 6, 2025
@mdjermanovic mdjermanovic added the cli Relates to ESLint's command-line interface label Jun 6, 2025
@@ -112,6 +112,14 @@ class SuppressionsService {
}
}

for (const file of Object.keys(suppressions)) {
Copy link
Member

Choose a reason for hiding this comment

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

I believe you should be able to do this within the loop above, otherwise we end up looping over keys twice. Can you take a look? (ref: #19778 (comment))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not possible because deleted files are not marked as unused since they are not included in the lint.

Copy link
Member

Choose a reason for hiding this comment

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

Ah gotcha. 👍

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.

LGTM. Would like another review before merging.

@nzakas nzakas moved this from Implementing to Second Review Needed in Triage Jun 10, 2025
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!

@mdjermanovic mdjermanovic merged commit 19cdd22 into eslint:main Jun 10, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jun 10, 2025
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 cli Relates to ESLint's command-line interface contributor pool feature This change adds a new feature to ESLint
4 participants