New: Add ESLint#getRulesMetaForResults() (refs #13654)#14716
Conversation
mdjermanovic
left a comment
There was a problem hiding this comment.
LGTM aside from the comments about the documentation.
Does this implementation match everyone's expectations?
I'd guess this covers all use cases where CLIEngine#getRules() was used, but can't be sure.
Assuming that it covers all use cases, I think it makes sense to require the results argument, as it clarifies this method and emphasizes that it should be called after ESLint#lintFiles()/ESLint#lintText().
|
Docs have been updated. I think between |
btmills
left a comment
There was a problem hiding this comment.
LGTM. Just one fix to the docs, and I'll commit that inline if you don't see it by the time I'm ready to do the release so it can go out today.
Co-authored-by: Brandon Mills <btmills@users.noreply.github.com>
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 autofixing to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Added the
ESLint#getRulesMetaForResults()method. This method was proposed asESLint#getRulesMetaForReport()but that wording was incorrect in the RFC because it'sCLIEnginethat return a report whileESLintreturns an array of results, so I updated the name to match that reality.,I chose to return an object so that the
rulesMetapassed to formatters is the same format rather than returning a map.This part of the RFC is non-breaking, which is why I chose to create a separate PR for it.
Is there anything you'd like reviewers to focus on?
Does this implementation match everyone's expectations?