-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Enable stricter linter rules. #1238
Conversation
Mostly trivial code changes made by running `dart fix --apply` The rules enabled are: - `prefer_final_locals`: https://dart-lang.github.io/linter/lints/prefer_final_locals.html - `prefer_final_in_for_each`: https://dart-lang.github.io/linter/lints/prefer_final_in_for_each.html - `avoid_dynamic_calls`: https://dart-lang.github.io/linter/lints/avoid_dynamic_calls.html All three rules take advantage of relatively recent improvements in the Dart SDK and thus "modernize" the codebase, they can potentially have a positive impact on performance as described in the reference links.
I've also enabled While I was looking at the imports I've also notice that |
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.
Looks fine to me, and happy for it to be merged if ok with it. Thanks for the work.
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.
Mostly looks good. A couple of things to maybe change though, suggested below. Happy to approve or change suggestions if you disagree! Many thanks, it's already looking much better.
Co-authored-by: Luka S <[email protected]>
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.
In that case, I'm happy to merge as well. Many thanks for your contributions!
Mostly trivial code changes made by running
dart fix --apply
The new most important rules enabled are:
prefer_final_locals
: https://dart-lang.github.io/linter/lints/prefer_final_locals.htmlprefer_final_in_for_each
: https://dart-lang.github.io/linter/lints/prefer_final_in_for_each.htmlavoid_dynamic_calls
: https://dart-lang.github.io/linter/lints/avoid_dynamic_calls.htmlAll three rules take advantage of relatively recent improvements in the Dart SDK and thus "modernize" the codebase (eg. getting rid of all those
var
), they can potentially have a positive impact on performance as described in the reference links while also ensuring correctness long term.I've also re-enabled
library_private_types_in_public_api
that is present influtter_lints
and was overridden locally.EDIT:
missing_required_param
andmissing_return
to errors in the analyzer and also enabled the "strong-mode" to avoid weak implicit casts and implicit dynamic.