Skip to content
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

docs(bloc_lint): Add lint documentation to bloclibrary.dev #4279

Open
1 of 3 tasks
vmichalak opened this issue Nov 10, 2024 · 2 comments
Open
1 of 3 tasks

docs(bloc_lint): Add lint documentation to bloclibrary.dev #4279

vmichalak opened this issue Nov 10, 2024 · 2 comments
Labels
documentation Documentation requested pkg:bloc_lint This issue is related to the bloc_lint package
Milestone

Comments

@vmichalak
Copy link
Collaborator

vmichalak commented Nov 10, 2024

Description

According to the discussion on #4278 between @felangel and @zbarbuto :

  • Move bloc_lint documentation from /packages/bloc_lint/doc to bloclibrary.dev.
  • Add more information of WHY this lint rule exists on documentation page.

Examples given by @zbarbuto during the discussion:

avoid_public_method_on_bloc
Blocs are intended to be interacted with by adding events via the .add() method only. By exposing public methods it may be tempting to treat the bloc as if it were a cubit.

avoid_public_properties_on_bloc_and_cubit
Exposing public properties can lead to anti-patterns such as having public state that is not part of the state property or using repositories and services exposed by the bloc in the widget tree that should be accessed via other means such as RepositoryProvider.of() or context.read<T>()

prefer_multi_bloc_listener
MultiBlocListeners reduce nesting, make it easier to see what blocs are provided at the current widget tree level and can make refactoring easier.

Outside of the discussion but could be cool to add it :

  •  Add "exists from: 0.1.0" on documentation page.
@vmichalak vmichalak added documentation Documentation requested pkg:bloc_lint This issue is related to the bloc_lint package labels Nov 10, 2024
vmichalak added a commit to vmichalak/bloc that referenced this issue Nov 11, 2024
@xoliq0v
Copy link

xoliq0v commented Nov 17, 2024

Hi everyone! 👋

I’d love to help add the bloc_lint documentation to bloclibrary.dev. Based on the discussion in #4278, here’s the approach I would take:
1. Moving Documentation: I’ll transfer the existing documentation from /packages/bloc_lint/doc to bloclibrary.dev.
2. Expanding Rule Descriptions: I’ll add explanations on why each lint rule exists, following the examples provided by @zbarbuto:
• avoid_public_method_on_bloc: To prevent misuse by encouraging .add() as the sole interaction method.
• avoid_public_properties_on_bloc_and_cubit: To prevent anti-patterns such as exposing properties that shouldn’t be accessed directly.
• prefer_multi_bloc_listener: To improve readability, reduce nesting, and simplify refactoring by using MultiBlocListener.
3. Including Version Information: I’ll add “exists from: 0.1.0” to indicate when each rule was introduced.

Please let me know if this sounds good or if there’s anything specific to add. I’m looking forward to contributing!

Thanks!

@felangel
Copy link
Owner

Hi everyone! 👋

I’d love to help add the bloc_lint documentation to bloclibrary.dev. Based on the discussion in #4278, here’s the approach I would take: 1. Moving Documentation: I’ll transfer the existing documentation from /packages/bloc_lint/doc to bloclibrary.dev. 2. Expanding Rule Descriptions: I’ll add explanations on why each lint rule exists, following the examples provided by @zbarbuto: • avoid_public_method_on_bloc: To prevent misuse by encouraging .add() as the sole interaction method. • avoid_public_properties_on_bloc_and_cubit: To prevent anti-patterns such as exposing properties that shouldn’t be accessed directly. • prefer_multi_bloc_listener: To improve readability, reduce nesting, and simplify refactoring by using MultiBlocListener. 3. Including Version Information: I’ll add “exists from: 0.1.0” to indicate when each rule was introduced.

Please let me know if this sounds good or if there’s anything specific to add. I’m looking forward to contributing!

Thanks!

Thanks for the interest and offering to help! I’d hold off for a few days since I’m in the process of proposing new lint rules (the original was more of a proof of concept). Once we’ve nailed down the initial batch of lint rules we can split up the work implementing and documenting each one. Hope that makes sense, thanks!

@felangel felangel added this to the v9.0.0 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation requested pkg:bloc_lint This issue is related to the bloc_lint package
Projects
None yet
Development

No branches or pull requests

3 participants