Skip to content

Conversation

Eittipat
Copy link
Contributor

@Eittipat Eittipat commented Jul 11, 2025

Status

READY

Breaking Changes

NO

Description

feat(bloc_lint): prefer_context_extensions #4456

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@Eittipat Eittipat requested a review from felangel as a code owner July 11, 2025 16:04
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Eittipat Eittipat force-pushed the feature/prefer_context_extensions branch from 2fdc86b to ecd913a Compare July 15, 2025 13:14
@felangel felangel force-pushed the master branch 2 times, most recently from abff5bd to 4700d6f Compare July 17, 2025 03:09
@Eittipat Eittipat force-pushed the feature/prefer_context_extensions branch from ecd913a to 6e25ea1 Compare July 18, 2025 03:26
@Eittipat
Copy link
Contributor Author

Hi @felangel
I've added some lint rules and hope they align with the requirements.
Please Let me know if there’s anything I can improve.

@felangel felangel added enhancement New feature or request pkg:bloc_lint This issue is related to the bloc_lint package labels Jul 20, 2025
@Eittipat Eittipat force-pushed the feature/prefer_context_extensions branch 4 times, most recently from 407978d to d7c215d Compare July 20, 2025 11:34
@felangel
Copy link
Owner

I'll take care of resolving the conflicts and getting this merged shortly, thanks!

@felangel felangel self-assigned this Jul 20, 2025
@felangel felangel changed the title feat(bloc_lint): add prefer_context_extensions lint rule feat(bloc_lint): add prefer_build_context_extensions lint rule Jul 23, 2025
@felangel felangel force-pushed the feature/prefer_context_extensions branch from d7c215d to 141c37c Compare July 23, 2025 22:21
Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all your contributions! I really appreciate it 🙏
Unfortunately, I think this PR still needs some work because it currently only accounts for BlocProvider.of and RepositoryProvider.of but there are many other cases that aren't accounted for in these changes. For example, I would expect this lint rule to lint when using BlocBuilder and recommend using context.watch instead. I would also expect this lint rule to lint when using BlocSelector and recommend using context.select instead.

Let me know if you want to rework this PR to incorporate those changes or if you'd prefer me to take it over and thanks again for taking the time to contribute 💙

@Eittipat
Copy link
Contributor Author

@felangel I will take care of it. However, I think I need a clearer requirement—like, if BlocBuilder has buildWhen, should context.watch still be recommended?"

@felangel
Copy link
Owner

@felangel I will take care of it. However, I think I need a clearer requirement—like, if BlocBuilder has buildWhen, should context.watch still be recommended?"

Thanks! For now I’d always recommend context.watch for BlocBuilder (eventually I want to deprecate and remove buildWhen).

@felangel
Copy link
Owner

felangel commented Jul 27, 2025

@felangel I will take care of it. However, I think I need a clearer requirement—like, if BlocBuilder has buildWhen, should context.watch still be recommended?"

@Eittipat have you had a chance to work on this? If not that’s totally fine I’m happy to help finish this off.

@Eittipat
Copy link
Contributor Author

@felangel I was planning to work on this over the weekend, but I ended up being a bit busy. Feel free to take it.

Thank you

@Eittipat
Copy link
Contributor Author

@felangel Any update on this

@felangel
Copy link
Owner

@felangel Any update on this

Planning to pick this up now, sorry for the delay!

@felangel felangel changed the title feat(bloc_lint): add prefer_build_context_extensions lint rule feat(bloc_lint): add prefer_build_context_extensions Sep 21, 2025
@felangel felangel linked an issue Sep 21, 2025 that may be closed by this pull request
Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks so much for the contribution! 💙

@felangel felangel merged commit e39c011 into felangel:master Sep 21, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:bloc_lint This issue is related to the bloc_lint package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(bloc_lint): prefer_build_context_extensions
2 participants