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

Improve no_empty_blocks #172

Open
arthurbcd opened this issue May 9, 2024 · 0 comments
Open

Improve no_empty_blocks #172

arthurbcd opened this issue May 9, 2024 · 0 comments

Comments

@arthurbcd
Copy link

Some empty blocks such as setState should and can be empty in some cases:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#comment-empty-closures-to-setstate

I suggest adding an option to resolve the lint when adding any comments, other than just TODO.

no_empty_blocks:
  allow_todos: true
  allow_comments: true

It would be also interesting to improve the linter message, instead of just "Block is empty...".

Depending on the configuration, we could say something like:
LINTER: "Empty blocks are often indicators of missing code. Either implement it or add a TODO/comment."

I can see this as a really strong lint to find all empty blocks when needed, by just changing those values of the linter.

Thanks for this linter. Has been really useful for me and my team. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant