-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(lint): add avoid_async_emit rule with tests and documentation #4585
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
base: master
Are you sure you want to change the base?
Conversation
Hello @felangel I've implemented the avoid_async_emit lint rule based on the open issue regarding unguarded emit calls inside async methods. This rule helps ensure emit is properly guarded with isClosed checks to prevent potential runtime issues. Please review and let me know if any adjustments are needed! ps. This is my first time contributing a lint rule. Please let me know if there are any improvements I can make or if there's a better approach I should follow. |
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.
Thanks so much for the PR! I haven't thoroughly reviewed the code yet but at first glance I think changes are needed since this lint rule should apply to both Bloc and Cubit instances. Currently it looks like this is implemented to ignore Bloc instances entirely.
…nt tests for Bloc
You were right—I needed to include Bloc as well. I updated the condition in handleIdentifier to check for both Cubit and Bloc tokens. Thanks for pointing it out! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4585 +/- ##
===========================================
- Coverage 100.00% 99.83% -0.17%
===========================================
Files 61 62 +1
Lines 1793 1867 +74
===========================================
+ Hits 1793 1864 +71
- Misses 0 3 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Great job, bro, you were amazing. |
Just wanted to say this is still very much on my radar -- I need to get #4562 merged first and then this is next on my list to review and get merged. Thanks so much for taking the time to contribution! 💙 |
Sorry for the delay! This is next on my todo list and I'm hoping to get this reviewed and merged in the next few days. |
Status
READY
Breaking Changes
NO
Description
Type of Change