Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update LoadedFormatter and FormatterFunction typedefs
Originally suggested by @fasttime in #16348 (comment). Internally, I define two types, `MaxWarningsExceeded` and `ResultsMeta`, that the updated `LoadedFormatter` and `FormatterFunction` types can use. I'm then able to reuse the `ResultsMeta` type instead of the generic `Object` type in `ESLint` and `FlatESLint`'s `format` wrapper functions. Externally in the Node.js API docs, I describe the new second argument to `LoadedFormatter`'s `format` method inline rather than separately documenting the new types. While working on this, I noticed that `FlatESLint` is using the pre-PR #15727 `Formatter` type rather than `LoadedFormatter` and `FormatterFunction`. I'll fix that in a follow-up PR to keep this PR scoped to passing `maxWarningsExceeded` info.
- Loading branch information
Showing
5 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters