-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update log.js to support async reporter plugins #71
Conversation
Async reporters can be easily supported by `await`ing the reporter function.
Potentially related issue comment. Unclear if the decision to have reporter plugins be sync was an intentional design decision. #62 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see why this is useful. The types need to be updated though.
ESLint 8 also added support for async reporters.
I am getting type errors on Not sure I can get this PR passing until main is working... |
Can you add a test? (https://github.com/unifiedjs/unified-engine/blob/main/test/reporting.js) This should perhaps also be added to https://github.com/vfile/vfile/blob/03efac7cc3a67fe33bb7a0f1de29e17be322549e/lib/index.js#L46 |
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2555 2555
=========================================
Hits 2555 2555
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@wooorm Test added and passing |
This comment has been minimized.
This comment has been minimized.
Thanks, released in 10.1.0! |
Async reporters can be easily supported by
await
ing the reporter function.Initial checklist
Description of changes
Log.js can easily support sync reporter plugins by awaiting the reporter function. Currently the reporter function is called as a sync function.
Example: vfile-reporter-junit
https://github.com/kellyselden/vfile-reporter-junit/blob/master/index.js