Skip to content

feat: support bulk suppressions - #292

Closed
viddo wants to merge 4 commits into
webpack:mainfrom
viddo:fix-not-fail-on-suppressions
Closed

feat: support bulk suppressions#292
viddo wants to merge 4 commits into
webpack:mainfrom
viddo:fix-not-fail-on-suppressions

Conversation

@viddo

@viddo viddo commented Dec 5, 2025

Copy link
Copy Markdown

Summary

Fixes #291 by adding support for loading SuppressionsService from ESLint that is currently used from CLI.

What kind of change does this PR introduce?

feature/bugfix

Did you add tests for your changes?

Does this PR introduce a breaking change?

No, it only amends/fix the suppressions feature.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

New option suppressionsLocation to indicate where the suppressions file is located (if not on default location).

@linux-foundation-easycla

linux-foundation-easycla Bot commented Dec 5, 2025

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ricardogobbosouza / name: Ricardo Gobbo de Souza (a6eeef1)

@viddo viddo changed the title feat: Fix errors despite bulk suppressions feat: support bulk suppressions Dec 5, 2025

@alexander-akait alexander-akait left a comment

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.

Can you accept CLA? Thank you

Comment thread src/applySuppressions.js Outdated
*/
function getSuppressionsService() {
// ESLint doesn't export SuppressionsService in package.json exports,
// so we need to resolve the path directly

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.

We need to open an issue in eslint repo, ideally they should export or provide API for such things

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

There's already an open issue for programmatic usage, eslint/eslint#19603 and active RFC eslint/rfcs#142. From what I can tell, the RFC proposes adding applySuppressions as constructor option to the ESLint class which I believe would make this fn moot. But since it's still RFC may take a while longer before an implementation is available on stable version. I understand a workaround may not be desirable in the meantime.

How do you want to proceed? Should we close this PR, until it can be solved proper using official APIs?

@alexander-akait alexander-akait Feb 20, 2026

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.

Let's add a TODO with links above and we can merge, when they resolved it we will migrate to the official API, sorry for delay

@viddo viddo Feb 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, fde678f.

And no worries about delay! I've also been busy and disconnecting over holidays. No rush from my side about this. Have a great weekend!

Make comment into a TODO to explain and motivate fix for workaround in
the future.

@alexander-akait alexander-akait left a comment

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.

/cc @ricardogobbosouza Can you look at this too, thanks

@ricardogobbosouza

Copy link
Copy Markdown
Contributor

Eslint suppressions are only available on eslint >=9

Wait #295

@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@ricardogobbosouza

Copy link
Copy Markdown
Contributor

@viddo could you please review testing and coverage?

alexander-akait added a commit that referenced this pull request Sep 7, 2026
ESLint 10 takes `applySuppressions` and `suppressionsLocation` as constructor
options, and the plugin already hands every ESLint option through, so the
feature works with no code of its own. Cover it so a change to the
pass-through cannot drop it silently, and document that ESLint resolves the
suppressions file against its own `cwd` rather than the plugin's `context`.

Closes #291. Supersedes #292, which predates the constructor options and
reached into `eslint/lib/services/suppressions-service.js` instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
alexander-akait added a commit that referenced this pull request Sep 7, 2026
…ecks` (#311)

* test: cover ESLint bulk suppressions

ESLint 10 takes `applySuppressions` and `suppressionsLocation` as constructor
options, and the plugin already hands every ESLint option through, so the
feature works with no code of its own. Cover it so a change to the
pass-through cannot drop it silently, and document that ESLint resolves the
suppressions file against its own `cwd` rather than the plugin's `context`.

Closes #291. Supersedes #292, which predates the constructor options and
reached into `eslint/lib/services/suppressions-service.js` instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy

* refactor!: rename to diagnostics-webpack-plugin and the option to `checks`

`lint-webpack-plugin` and `linter-webpack-plugin` are both taken on npm, by
packages published in 2018 and 2019. `diagnostics` is the term the tools
themselves use — TypeScript reports Diagnostics, and so does the Language
Server Protocol — so it covers the linters running today and the type
checkers and analysers meant to follow, without naming any of them.

The option follows: `linters` becomes `checks`, `src/linters/` becomes
`src/checks/`, and `LintError` becomes `DiagnosticError`. Nothing shipped
under the old name, so the changelog still records the move as coming from
`eslint-webpack-plugin`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy

* chore: start the renamed package at 1.0.0

`diagnostics-webpack-plugin` is a new package on npm, so its versions start
over rather than continuing `eslint-webpack-plugin`'s. Setting the version to
0.0.0 makes the pending majors resolve to 1.0.0, and the changelog says which
of its entries belong to the old package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
alexander-akait added a commit that referenced this pull request Sep 7, 2026
ESLint 10 takes `applySuppressions` and `suppressionsLocation` as constructor
options and the plugin already passes them through. ESLint 9.24 ships the same
service but wires it into its CLI alone, so the plugin now drives it after
linting, resolving the file and the paths inside it against ESLint's `cwd`
exactly as ESLint 10 does. Below 9.24 the option raises an error naming the
version rather than silently reporting what was meant to be suppressed.

The service is read by path because ESLint's `exports` hides it; the manifest
is resolved through `eslint/package.json`, which works on Windows too. Covers
an absolute `suppressionsLocation`, a nested file and a suppressions file
outside `cwd`, the cases #292 raised.

Closes #291. Supersedes #292.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
alexander-akait added a commit that referenced this pull request Sep 7, 2026
ESLint 10 takes `applySuppressions` and `suppressionsLocation` as constructor
options and the plugin already passes them through. ESLint 9.24 ships the same
service but wires it into its CLI alone, so the plugin now drives it after
linting, resolving the file and the paths inside it against ESLint's `cwd`
exactly as ESLint 10 does. Below 9.24 the option raises an error naming the
version rather than silently reporting what was meant to be suppressed.

The service is read by path because ESLint's `exports` hides it; the manifest
is resolved through `eslint/package.json`, which works on Windows too. Covers
an absolute `suppressionsLocation`, a nested file and a suppressions file
outside `cwd`, the cases #292 raised.

Closes #291. Supersedes #292.


Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@alexander-akait

Copy link
Copy Markdown
Member

Fixed in the main

@alexander-akait

Copy link
Copy Markdown
Member

Anyway thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors despite bulk suppressions

3 participants