-
Notifications
You must be signed in to change notification settings - Fork 28
Disable omit_local_variable_types
rule
#4
Comments
Hi @anticafe ✋, thanks for opening an issue! This lint follows this guide's rule. I think this is a good rule, because of the reason mentioned there. However, if you want to use most of the other Effective Dart lint rules, you can disable this rule by yourself, as mentioned in #3. (I will enhance README later today) Of course you can share your opinion on this, thanks! |
Or, if you want to use this lint in most of the cases, you can also supress this rule for specific file or line. See https://dart.dev/guides/language/analysis-options#suppressing-rules-for-a-file or https://dart.dev/guides/language/analysis-options#suppressing-rules-for-a-line-of-code |
Thanks for your response @tenhobi For me, depend on the name of method on the right-hand side then I would use |
OK, I see the issue. This lint is good, but there are cases where it is not required. Now there is a question of what is better: disabling or suppressing. We might want to wait for some response from the comunity. @felangel can you give your opinion? You modified a lot of code. |
There are project who do and do not use this rule. In flutter it's disabled, in e.g. https://github.com/google/flutter-desktop-embedding it's enabled. Dunno what to choose. |
omit_local_variable_types
ruleomit_local_variable_types
rule
Hi, first of all, thanks again for opening this issue. 🎉 As mentioned in #6, we will not disable rules if they work properly according to the rules and across all tools. Only exception might be I know there are many rules which might not always suit your project needs, but this package should primarily cover Effective Dart rules. And you can always suppress those lints you don't want to follow, as mentioned in the README. 👍 |
I think we could disable omit_local_variable_types by default.
At the moment, below code will cause a warning
But this one will not:
However,
User user = ...
will make code easy to understand, and if anyone needs to viewUser
source code, he can press Ctrl and click onUser
to navigate toUser
class.I believe after compiling, such
var
will be replaced by the correct type (User
).Thus, I think we should disable
omit_local_variable_types
by default.The text was updated successfully, but these errors were encountered: