Conversation
|
|
| */ | ||
| function getSuppressionsService() { | ||
| // ESLint doesn't export SuppressionsService in package.json exports, | ||
| // so we need to resolve the path directly |
There was a problem hiding this comment.
We need to open an issue in eslint repo, ideally they should export or provide API for such things
There was a problem hiding this comment.
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?
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
suppressionsLocationto indicate where the suppressions file is located (if not on default location).