Skip to content

feat: Implement api support for bulk-suppressions#20565

Merged
mdjermanovic merged 7 commits intoeslint:mainfrom
adf0nt3s:feat/implement-api-suppressions
Mar 16, 2026
Merged

feat: Implement api support for bulk-suppressions#20565
mdjermanovic merged 7 commits intoeslint:mainfrom
adf0nt3s:feat/implement-api-suppressions

Conversation

@adf0nt3s
Copy link
Copy Markdown
Contributor

@adf0nt3s adf0nt3s commented Feb 26, 2026

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

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

[x] 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: bulk suppression support for the Eslint API

What changes did you make? (Give an overview)

This implements API support for bulk suppressions, as outlined here eslint/rfcs#142

fixes #19603

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

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Feb 26, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 74449e6
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/69b579d141d347000899bb41

@eslint-github-bot
Copy link
Copy Markdown

Hi @adf0nt3s!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@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 26, 2026
@eslint-github-bot
Copy link
Copy Markdown

Hi @adf0nt3s!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

2 similar comments
@eslint-github-bot
Copy link
Copy Markdown

Hi @adf0nt3s!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@eslint-github-bot
Copy link
Copy Markdown

Hi @adf0nt3s!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@adf0nt3s adf0nt3s changed the title [draft] Implement api support for bulk-suppressions feat: Implement api support for bulk-suppressions Feb 26, 2026
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Feb 26, 2026
@adf0nt3s adf0nt3s force-pushed the feat/implement-api-suppressions branch 2 times, most recently from 041fb41 to 9aa94f6 Compare February 26, 2026 04:49
@adf0nt3s adf0nt3s marked this pull request as ready for review February 26, 2026 04:58
@adf0nt3s adf0nt3s requested a review from a team as a code owner February 26, 2026 04:58
@fasttime fasttime moved this from Needs Triage to Triaging in Triage Mar 2, 2026
@fasttime fasttime added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 2, 2026
@fasttime fasttime moved this from Triaging to Implementing in Triage Mar 2, 2026
Copy link
Copy Markdown
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request. I left some suggestions.

@adf0nt3s
Copy link
Copy Markdown
Contributor Author

adf0nt3s commented Mar 6, 2026

The note about circular deps aside, i've implemented the feedback 👍

Copy link
Copy Markdown
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

It would be good to have a test where suppressionsLocation is set to an absolute path.

@adf0nt3s adf0nt3s force-pushed the feat/implement-api-suppressions branch from b9dadea to 4c0367c Compare March 13, 2026 00:07
@adf0nt3s adf0nt3s force-pushed the feat/implement-api-suppressions branch from 4c0367c to b6379b9 Compare March 13, 2026 00:12
);
} finally {
// Clean up cache file
fs.rmSync(cacheLocation, { force: true });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this, let me know if there is a better optoin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we move this unit test into the testCacheWithConcurrency function, where the other cache-related tests are, then we can set cacheFilePath to some temporary directory, for example:

cacheFilePath = getFixturePath(".eslintcache");

and use that directory as a cacheLocation in the ESLint options. And then, when the test finishes, cacheLocation will be deleted automatically.

eslint/tests/lib/eslint/eslint.js

Lines 12878 to 12883 in a176319

afterEach(() => {
sinon.restore();
if (cacheFilePath) {
doDelete(cacheFilePath);
}
});

Note: unit tests inside testCacheWithConcurrency should also pass the concurrency option, which is useful to test the cache handling in separate parts of the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nice, done

);
} finally {
// Clean up cache file
fs.rmSync(cacheLocation, { force: true });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we move this unit test into the testCacheWithConcurrency function, where the other cache-related tests are, then we can set cacheFilePath to some temporary directory, for example:

cacheFilePath = getFixturePath(".eslintcache");

and use that directory as a cacheLocation in the ESLint options. And then, when the test finishes, cacheLocation will be deleted automatically.

eslint/tests/lib/eslint/eslint.js

Lines 12878 to 12883 in a176319

afterEach(() => {
sinon.restore();
if (cacheFilePath) {
doDelete(cacheFilePath);
}
});

Note: unit tests inside testCacheWithConcurrency should also pass the concurrency option, which is useful to test the cache handling in separate parts of the code.

@adf0nt3s adf0nt3s force-pushed the feat/implement-api-suppressions branch from 8c2bfd2 to 74449e6 Compare March 14, 2026 15:07
Copy link
Copy Markdown
Member

@fasttime fasttime 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! Leaving open for another review.

@fasttime fasttime moved this from Implementing to Second Review Needed in Triage Mar 16, 2026
Copy link
Copy Markdown
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 0916995 into eslint:main Mar 16, 2026
42 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Mar 16, 2026
@adf0nt3s
Copy link
Copy Markdown
Contributor Author

Excellent, thanks friends!

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 core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Change Request: Support bulk suppression in Node.js API

4 participants